From 852004a22ab674a4d0d55ba6660b87dc92f43638 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 17 Oct 2013 11:32:14 -0700 Subject: [PATCH] The _SC_PHYS_PAGES method of calculating RAM works on Linux. --- src/cpuinfo/SDL_cpuinfo.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/cpuinfo/SDL_cpuinfo.c b/src/cpuinfo/SDL_cpuinfo.c index f6f4542e93003..c59b51b873284 100644 --- a/src/cpuinfo/SDL_cpuinfo.c +++ b/src/cpuinfo/SDL_cpuinfo.c @@ -636,25 +636,6 @@ SDL_GetSystemRAM(void) SDL_SystemRAM = (int)(stat.ullTotalPhys / (1024 * 1024)); } } -#endif -#if 0 //def __LINUX__ - FILE *fpMemInfo = fopen("/proc/meminfo", "r"); - if (fpMemInfo) { - char line[1024]; - const char *search = "MemTotal:"; - const size_t searchlen = SDL_strlen(search); - while (fgets(line, sizeof(line), fpMemInfo)) { - if (SDL_strncasecmp(search, line, searchlen) == 0) { - char *val = line+searchlen; - while (SDL_isspace(*val)) { - ++val; - } - SDL_SystemRAM = SDL_atoi(val) / 1024; /* convert from kB to MB */ - break; - } - } - fclose(fpMemInfo); - } #endif } return SDL_SystemRAM;