mirror of
https://gitflic.ru/project/erthink/libmdbx.git
synced 2025-10-27 18:28:25 +00:00
mdbx: alter the globals.sys_allocation_granularity guessing.
This commit is contained in:
parent
26d5ef6b2d
commit
9c0886972d
@ -3475,10 +3475,10 @@ void osal_ctor(void) {
|
|||||||
globals.sys_allocation_granularity = si.dwAllocationGranularity;
|
globals.sys_allocation_granularity = si.dwAllocationGranularity;
|
||||||
#else
|
#else
|
||||||
globals.sys_pagesize = sysconf(_SC_PAGE_SIZE);
|
globals.sys_pagesize = sysconf(_SC_PAGE_SIZE);
|
||||||
globals.sys_allocation_granularity = (MDBX_WORDBITS > 32) ? 65536 : 4096;
|
globals.sys_allocation_granularity = (MDBX_WORDBITS > 32) ? 65536 : 16384;
|
||||||
globals.sys_allocation_granularity = (globals.sys_allocation_granularity > globals.sys_pagesize)
|
globals.sys_allocation_granularity = (globals.sys_allocation_granularity >= globals.sys_pagesize * 2)
|
||||||
? globals.sys_allocation_granularity
|
? globals.sys_allocation_granularity
|
||||||
: globals.sys_pagesize;
|
: globals.sys_pagesize * 4;
|
||||||
#endif
|
#endif
|
||||||
assert(globals.sys_pagesize > 0 && (globals.sys_pagesize & (globals.sys_pagesize - 1)) == 0);
|
assert(globals.sys_pagesize > 0 && (globals.sys_pagesize & (globals.sys_pagesize - 1)) == 0);
|
||||||
assert(globals.sys_allocation_granularity >= globals.sys_pagesize &&
|
assert(globals.sys_allocation_granularity >= globals.sys_pagesize &&
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user