Changeset 46330 in vbox for trunk/src/VBox/Main/src-server/HostImpl.cpp
- Timestamp:
- May 30, 2013 12:41:48 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/HostImpl.cpp
r46326 r46330 1042 1042 // no locking required 1043 1043 1044 /* @todo This is an ugly hack. There must be a function in IPRT for that. */1045 pm::CollectorHAL *hal = pm::createHAL();1046 if ( !hal)1044 uint64_t cb; 1045 int rc = RTSystemQueryTotalRam(&cb); 1046 if (RT_FAILURE(rc)) 1047 1047 return E_FAIL; 1048 ULONG tmp; 1049 int rc = hal->getHostMemoryUsage(aSize, &tmp, &tmp); 1050 *aSize /= 1024; 1051 delete hal; 1052 return rc; 1048 *aSize = cb / _1M; 1049 return S_OK; 1053 1050 } 1054 1051 … … 1064 1061 // no locking required 1065 1062 1066 /* @todo This is an ugly hack. There must be a function in IPRT for that. */1067 pm::CollectorHAL *hal = pm::createHAL();1068 if ( !hal)1063 uint64_t cb; 1064 int rc = RTSystemQueryAvailableRam(&cb); 1065 if (RT_FAILURE(rc)) 1069 1066 return E_FAIL; 1070 ULONG tmp; 1071 int rc = hal->getHostMemoryUsage(&tmp, &tmp, aAvailable); 1072 *aAvailable /= 1024; 1073 delete hal; 1074 return rc; 1067 *aAvailable = cb / _1M; 1068 return S_OK; 1075 1069 } 1076 1070
Note:
See TracChangeset
for help on using the changeset viewer.