mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-14 22:51:50 +03:00
Fix wrong fallback value in os_page_detect when sysconf fails
Returned LG_PAGE (log2 of page size, e.g. 12) instead of PAGE (actual page size, e.g. 4096) when sysconf(_SC_PAGESIZE) failed. This would cause os_page to be set to an absurdly small value, breaking all page-aligned operations.
This commit is contained in:
parent
3a8bee81f1
commit
dd30c91eaa
1 changed files with 1 additions and 1 deletions
|
|
@ -718,7 +718,7 @@ os_page_detect(void) {
|
|||
#else
|
||||
long result = sysconf(_SC_PAGESIZE);
|
||||
if (result == -1) {
|
||||
return LG_PAGE;
|
||||
return PAGE;
|
||||
}
|
||||
return (size_t)result;
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue