mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-24 13:53:11 +00: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:
@@ -718,7 +718,7 @@ os_page_detect(void) {
|
|||||||
#else
|
#else
|
||||||
long result = sysconf(_SC_PAGESIZE);
|
long result = sysconf(_SC_PAGESIZE);
|
||||||
if (result == -1) {
|
if (result == -1) {
|
||||||
return LG_PAGE;
|
return PAGE;
|
||||||
}
|
}
|
||||||
return (size_t)result;
|
return (size_t)result;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user