mdbx: исправление несогласованности MDBX_DPL_PREALLOC_FOR_RADIXSORT и assert-проверки внутри dpl_bytes2size().

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2024-12-21 18:05:39 +03:00
parent b9e4c1ea73
commit a76e06a48e

View File

@ -20,10 +20,10 @@ static inline size_t dpl_size2bytes(ptrdiff_t size) {
static inline size_t dpl_bytes2size(const ptrdiff_t bytes) { static inline size_t dpl_bytes2size(const ptrdiff_t bytes) {
size_t size = (bytes - sizeof(dpl_t)) / sizeof(dp_t); size_t size = (bytes - sizeof(dpl_t)) / sizeof(dp_t);
assert(size > CURSOR_STACK_SIZE && size <= PAGELIST_LIMIT + MDBX_PNL_GRANULATE);
#if MDBX_DPL_PREALLOC_FOR_RADIXSORT #if MDBX_DPL_PREALLOC_FOR_RADIXSORT
size >>= 1; size >>= 1;
#endif /* MDBX_DPL_PREALLOC_FOR_RADIXSORT */ #endif /* MDBX_DPL_PREALLOC_FOR_RADIXSORT */
assert(size > CURSOR_STACK_SIZE && size <= PAGELIST_LIMIT + MDBX_PNL_GRANULATE);
return size; return size;
} }