diff options
-rw-r--r-- | util/processinfo_win32.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/util/processinfo_win32.cpp b/util/processinfo_win32.cpp index 7148cf3fba1..111ee069b4b 100644 --- a/util/processinfo_win32.cpp +++ b/util/processinfo_win32.cpp @@ -47,9 +47,11 @@ namespace mongo { int ProcessInfo::getVirtualMemorySize(){ MEMORYSTATUSEX mse; - mse.dwLength = sizeof(mse); + mse.dwLength = sizeof(mse); assert( GlobalMemoryStatusEx( &mse ) ); - return (mse.ullTotalVirtual - mse.ullAvailVirtual) / (1024 * 1024) ; + DWORDLONG x = (mse.ullTotalVirtual - mse.ullAvailVirtual) / (1024 * 1024) ; + assert( x <= 0x7fffffff ); + return (int) x; } int ProcessInfo::getResidentSize(){ |