mirror of https://gitee.com/bigwinds/arangodb
added windows mem function
This commit is contained in:
parent
d37a5221ab
commit
58ca2f9647
|
@ -547,6 +547,8 @@
|
||||||
#define TRI_HAVE_STRTOI64 1
|
#define TRI_HAVE_STRTOI64 1
|
||||||
#define TRI_HAVE_STRTOUI64 1
|
#define TRI_HAVE_STRTOUI64 1
|
||||||
|
|
||||||
|
#define TRI_HAVE_WIN32_GLOBAL_MEMORY_STATUS 1
|
||||||
|
|
||||||
#define strcasecmp _stricmp
|
#define strcasecmp _stricmp
|
||||||
#define strncasecmp _strnicmp
|
#define strncasecmp _strnicmp
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
|
|
|
@ -303,12 +303,24 @@ uint64_t TRI_GetPhysicalMemory () {
|
||||||
return (uint64_t)(pages * page_size);
|
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
|
#else
|
||||||
|
|
||||||
uint64_t TRI_GetPhysicalMemory () {
|
uint64_t TRI_GetPhysicalMemory () {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue