1
0
Fork 0

added windows mem function

This commit is contained in:
Frank Celler 2014-03-01 17:28:06 +01:00
parent d37a5221ab
commit 58ca2f9647
2 changed files with 14 additions and 0 deletions

View File

@ -547,6 +547,8 @@
#define TRI_HAVE_STRTOI64 1
#define TRI_HAVE_STRTOUI64 1
#define TRI_HAVE_WIN32_GLOBAL_MEMORY_STATUS 1
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
#define snprintf _snprintf

View File

@ -303,12 +303,24 @@ uint64_t TRI_GetPhysicalMemory () {
return (uint64_t)(pages * page_size);
}
#else
#ifdef TRI_HAVE_WIN32_GLOBAL_MEMORY_STATUS
uint64_t getTotalSystemMemory() {
MEMORYSTATUSEX status;
status.dwLength = sizeof(status);
GlobalMemoryStatusEx(&status);
return (uint64_t) status.ullTotalPhys;
}
#else
uint64_t TRI_GetPhysicalMemory () {
return 0;
}
#endif
#endif
#endif