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

Side by Side Diff: nspr/pr/src/md/prosdep.c

Issue 2078763002: Delete bundled copy of NSS and replace with README. (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/nss@master
Patch Set: Delete bundled copy of NSS and replace with README. Created 4 years, 6 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
« no previous file with comments | « nspr/pr/src/malloc/prmem.c ('k') | nspr/pr/src/md/unix/darwin.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 #include "prbit.h"
7 #include "prsystem.h"
8
9 #ifdef XP_UNIX
10 #include <unistd.h>
11 #endif
12 #ifdef _WIN32
13 #include <windows.h>
14 #endif
15 #ifdef XP_BEOS
16 #include <OS.h>
17 #endif
18
19 PRInt32 _pr_pageShift;
20 PRInt32 _pr_pageSize;
21
22 /*
23 ** Get system page size
24 */
25 static void GetPageSize(void)
26 {
27 PRInt32 pageSize;
28
29 /* Get page size */
30 #ifdef XP_UNIX
31 #if defined BSDI || defined AIX \
32 || defined LINUX || defined __GNU__ || defined __GLIBC__ \
33 || defined FREEBSD || defined NETBSD || defined OPENBSD \
34 || defined DARWIN || defined SYMBIAN
35 _pr_pageSize = getpagesize();
36 #elif defined(HPUX)
37 /* I have no idea. Don't get me started. --Rob */
38 _pr_pageSize = sysconf(_SC_PAGE_SIZE);
39 #else
40 _pr_pageSize = sysconf(_SC_PAGESIZE);
41 #endif
42 #endif /* XP_UNIX */
43
44 #ifdef XP_BEOS
45 _pr_pageSize = B_PAGE_SIZE;
46 #endif
47
48 #ifdef XP_PC
49 #ifdef _WIN32
50 SYSTEM_INFO info;
51 GetSystemInfo(&info);
52 _pr_pageSize = info.dwPageSize;
53 #else
54 _pr_pageSize = 4096;
55 #endif
56 #endif /* XP_PC */
57
58 pageSize = _pr_pageSize;
59 PR_CEILING_LOG2(_pr_pageShift, pageSize);
60 }
61
62 PR_IMPLEMENT(PRInt32) PR_GetPageShift(void)
63 {
64 if (!_pr_pageSize) {
65 GetPageSize();
66 }
67 return _pr_pageShift;
68 }
69
70 PR_IMPLEMENT(PRInt32) PR_GetPageSize(void)
71 {
72 if (!_pr_pageSize) {
73 GetPageSize();
74 }
75 return _pr_pageSize;
76 }
OLDNEW
« no previous file with comments | « nspr/pr/src/malloc/prmem.c ('k') | nspr/pr/src/md/unix/darwin.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698