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

Side by Side Diff: nspr/pr/src/misc/prsystem.c

Issue 407383002: Update to NSPR 4.10.7 Beta 3. (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/nss
Patch Set: Created 6 years, 5 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « nspr/pr/src/md/windows/w95io.c ('k') | nspr/pr/src/pthreads/ptio.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public 2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 5
6 #include "primpl.h" 6 #include "primpl.h"
7 #include "prsystem.h" 7 #include "prsystem.h"
8 #include "prprf.h" 8 #include "prprf.h"
9 #include "prlong.h" 9 #include "prlong.h"
10 10
(...skipping 15 matching lines...) Expand all
26 #if defined(BSDI) || defined(FREEBSD) || defined(NETBSD) \ 26 #if defined(BSDI) || defined(FREEBSD) || defined(NETBSD) \
27 || defined(OPENBSD) || defined(DARWIN) 27 || defined(OPENBSD) || defined(DARWIN)
28 #define _PR_HAVE_SYSCTL 28 #define _PR_HAVE_SYSCTL
29 #include <sys/param.h> 29 #include <sys/param.h>
30 #include <sys/sysctl.h> 30 #include <sys/sysctl.h>
31 #endif 31 #endif
32 32
33 #if defined(DARWIN) 33 #if defined(DARWIN)
34 #include <mach/mach_init.h> 34 #include <mach/mach_init.h>
35 #include <mach/mach_host.h> 35 #include <mach/mach_host.h>
36 #include <mach/mach_port.h>
36 #endif 37 #endif
37 38
38 #if defined(HPUX) 39 #if defined(HPUX)
39 #include <sys/mpctl.h> 40 #include <sys/mpctl.h>
40 #include <sys/pstat.h> 41 #include <sys/pstat.h>
41 #endif 42 #endif
42 43
43 #if defined(XP_UNIX) 44 #if defined(XP_UNIX)
44 #include <unistd.h> 45 #include <unistd.h>
45 #include <sys/utsname.h> 46 #include <sys/utsname.h>
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 291
291 #elif defined(HPUX) 292 #elif defined(HPUX)
292 293
293 struct pst_static info; 294 struct pst_static info;
294 int result = pstat_getstatic(&info, sizeof(info), 1, 0); 295 int result = pstat_getstatic(&info, sizeof(info), 1, 0);
295 if (result == 1) 296 if (result == 1)
296 bytes = (PRUint64) info.physical_memory * info.page_size; 297 bytes = (PRUint64) info.physical_memory * info.page_size;
297 298
298 #elif defined(DARWIN) 299 #elif defined(DARWIN)
299 300
301 mach_port_t mach_host = mach_host_self();
300 struct host_basic_info hInfo; 302 struct host_basic_info hInfo;
301 mach_msg_type_number_t count = HOST_BASIC_INFO_COUNT; 303 mach_msg_type_number_t count = HOST_BASIC_INFO_COUNT;
302 304
303 int result = host_info(mach_host_self(), 305 int result = host_info(mach_host,
304 HOST_BASIC_INFO, 306 HOST_BASIC_INFO,
305 (host_info_t) &hInfo, 307 (host_info_t) &hInfo,
306 &count); 308 &count);
309 mach_port_deallocate(mach_task_self(), mach_host);
307 if (result == KERN_SUCCESS) 310 if (result == KERN_SUCCESS)
308 bytes = hInfo.max_mem; 311 bytes = hInfo.max_mem;
309 312
310 #elif defined(WIN32) 313 #elif defined(WIN32)
311 314
312 MEMORYSTATUSEX memStat; 315 MEMORYSTATUSEX memStat;
313 memStat.dwLength = sizeof(memStat); 316 memStat.dwLength = sizeof(memStat);
314 if (GlobalMemoryStatusEx(&memStat)) 317 if (GlobalMemoryStatusEx(&memStat))
315 bytes = memStat.ullTotalPhys; 318 bytes = memStat.ullTotalPhys;
316 319
(...skipping 19 matching lines...) Expand all
336 } 339 }
337 340
338 #else 341 #else
339 342
340 PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); 343 PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
341 344
342 #endif 345 #endif
343 346
344 return bytes; 347 return bytes;
345 } /* end PR_GetPhysicalMemorySize() */ 348 } /* end PR_GetPhysicalMemorySize() */
OLDNEW
« no previous file with comments | « nspr/pr/src/md/windows/w95io.c ('k') | nspr/pr/src/pthreads/ptio.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698