mdbx: extending MDBX_envinfo.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev)
2025-10-14 21:10:40 +03:00
parent 06b6739e68
commit 410bbbd9a5
7 changed files with 127 additions and 89 deletions

View File

@@ -3495,6 +3495,16 @@ void osal_ctor(void) {
globals.sys_allocation_granularity = (globals.sys_allocation_granularity >= globals.sys_pagesize * 2)
? globals.sys_allocation_granularity
: globals.sys_pagesize * 4;
#ifdef AT_UCACHEBSIZE
const size_t unified_cache_block_size = getauxval(AT_UCACHEBSIZE);
globals.sys_unified_cache_block = globals.sys_pagesize;
if (unified_cache_block_size > 0 && unified_cache_block_size < INT_MAX) {
globals.sys_unified_cache_block = (unsigned)unified_cache_block_size;
if (globals.sys_unified_cache_block > globals.sys_pagesize)
globals.sys_allocation_granularity = globals.sys_unified_cache_block;
}
#endif /* AT_UCACHEBSIZE */
#endif
assert(globals.sys_pagesize > 0 && (globals.sys_pagesize & (globals.sys_pagesize - 1)) == 0);
assert(globals.sys_allocation_granularity >= globals.sys_pagesize &&