mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-26 09:03:33 +03:00
Use getpagesize(3) under FreeBSD.
This avoids sysctl(2) syscall during binary startup, using the value passed in the ELF aux vector instead. Signed-off-by: Edward Tomasz Napierala <trasz@FreeBSD.org>
This commit is contained in:
parent
58eba024c0
commit
d591df05c8
1 changed files with 2 additions and 0 deletions
|
|
@ -357,6 +357,8 @@ os_page_detect(void) {
|
||||||
SYSTEM_INFO si;
|
SYSTEM_INFO si;
|
||||||
GetSystemInfo(&si);
|
GetSystemInfo(&si);
|
||||||
return si.dwPageSize;
|
return si.dwPageSize;
|
||||||
|
#elif defined(__FreeBSD__)
|
||||||
|
return getpagesize();
|
||||||
#else
|
#else
|
||||||
long result = sysconf(_SC_PAGESIZE);
|
long result = sysconf(_SC_PAGESIZE);
|
||||||
if (result == -1) {
|
if (result == -1) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue