mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-07 15:59:32 +03:00
double arena per 4; large page objects 1/8 of large page size
This commit is contained in:
parent
3fa3476712
commit
b77b34df96
2 changed files with 2 additions and 2 deletions
|
@ -324,7 +324,7 @@ typedef struct mi_page_s {
|
|||
// (Except for large pages since huge objects are allocated in 4MiB chunks)
|
||||
#define MI_SMALL_MAX_OBJ_SIZE ((MI_SMALL_PAGE_SIZE-MI_PAGE_INFO_SIZE)/8) // < 11 KiB
|
||||
#define MI_MEDIUM_MAX_OBJ_SIZE ((MI_MEDIUM_PAGE_SIZE-MI_PAGE_INFO_SIZE)/8) // < 128 KiB
|
||||
#define MI_LARGE_MAX_OBJ_SIZE ((MI_LARGE_PAGE_SIZE-MI_PAGE_INFO_SIZE)/4) // < 1 MiB
|
||||
#define MI_LARGE_MAX_OBJ_SIZE ((MI_LARGE_PAGE_SIZE-MI_PAGE_INFO_SIZE)/8) // < 1 MiB
|
||||
#define MI_LARGE_MAX_OBJ_WSIZE (MI_LARGE_MAX_OBJ_SIZE/MI_SIZE_SIZE)
|
||||
|
||||
|
||||
|
|
|
@ -280,7 +280,7 @@ static bool mi_arena_reserve(mi_subproc_t* subproc, size_t req_size, bool allow_
|
|||
|
||||
if (arena_count >= 1 && arena_count <= 128) {
|
||||
// scale up the arena sizes exponentially every 4 entries
|
||||
const size_t multiplier = (size_t)1 << _mi_clamp(arena_count/2, 0, 16);
|
||||
const size_t multiplier = (size_t)1 << _mi_clamp(arena_count/4, 0, 16);
|
||||
size_t reserve = 0;
|
||||
if (!mi_mul_overflow(multiplier, arena_reserve, &reserve)) {
|
||||
arena_reserve = reserve;
|
||||
|
|
Loading…
Add table
Reference in a new issue