Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: nspr/pr/src/misc/prsystem.c

Issue 68173008: Update to NSPR 4.10.2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Update README.chromium Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « nspr/pr/src/misc/prnetdb.c ('k') | nspr/pr/src/pthreads/ptio.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nspr/pr/src/misc/prsystem.c
===================================================================
--- nspr/pr/src/misc/prsystem.c (revision 233722)
+++ nspr/pr/src/misc/prsystem.c (working copy)
@@ -56,24 +56,6 @@
#include <sys/cfgodm.h>
#endif
-#if defined(WIN32)
-/* This struct is not present in VC6 headers, so declare it here */
-typedef struct {
- DWORD dwLength;
- DWORD dwMemoryLoad;
- DWORDLONG ullTotalPhys;
- DWORDLONG ullAvailPhys;
- DWORDLONG ullToalPageFile;
- DWORDLONG ullAvailPageFile;
- DWORDLONG ullTotalVirtual;
- DWORDLONG ullAvailVirtual;
- DWORDLONG ullAvailExtendedVirtual;
-} PR_MEMORYSTATUSEX;
-
-/* Typedef for dynamic lookup of GlobalMemoryStatusEx(). */
-typedef BOOL (WINAPI *GlobalMemoryStatusExFn)(PR_MEMORYSTATUSEX *);
-#endif
-
PR_IMPLEMENT(char) PR_GetDirectorySeparator(void)
{
return PR_DIRECTORY_SEPARATOR;
@@ -327,30 +309,11 @@
#elif defined(WIN32)
- /* Try to use the newer GlobalMemoryStatusEx API for Windows 2000+. */
- GlobalMemoryStatusExFn globalMemory = (GlobalMemoryStatusExFn) NULL;
- HMODULE module = GetModuleHandleW(L"kernel32.dll");
+ MEMORYSTATUSEX memStat;
+ memStat.dwLength = sizeof(memStat);
+ if (GlobalMemoryStatusEx(&memStat))
+ bytes = memStat.ullTotalPhys;
- if (module) {
- globalMemory = (GlobalMemoryStatusExFn)GetProcAddress(module, "GlobalMemoryStatusEx");
-
- if (globalMemory) {
- PR_MEMORYSTATUSEX memStat;
- memStat.dwLength = sizeof(memStat);
-
- if (globalMemory(&memStat))
- bytes = memStat.ullTotalPhys;
- }
- }
-
- if (!bytes) {
- /* Fall back to the older API. */
- MEMORYSTATUS memStat;
- memset(&memStat, 0, sizeof(memStat));
- GlobalMemoryStatus(&memStat);
- bytes = memStat.dwTotalPhys;
- }
-
#elif defined(OS2)
ULONG ulPhysMem;
« no previous file with comments | « nspr/pr/src/misc/prnetdb.c ('k') | nspr/pr/src/pthreads/ptio.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698