mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
enable more reset delay slots
This commit is contained in:
parent
5e6754f3f7
commit
a0958b2da6
5 changed files with 66 additions and 32 deletions
|
@ -390,13 +390,20 @@ void _mi_stat_counter_increase(mi_stat_counter_t* stat, size_t amount);
|
|||
// ------------------------------------------------------
|
||||
typedef int64_t mi_msecs_t;
|
||||
|
||||
#define MI_RESET_DELAY_SLOTS (256)
|
||||
|
||||
typedef struct mi_delay_slot_s {
|
||||
mi_msecs_t expire;
|
||||
uint8_t* addr;
|
||||
size_t size;
|
||||
} mi_delay_slot_t;
|
||||
|
||||
#define MI_RESET_DELAY_SLOTS (128)
|
||||
typedef struct mi_delay_slots_s {
|
||||
size_t capacity; // always `MI_RESET_DELAY_SLOTS`
|
||||
size_t count; // current slots used (`<= capacity`)
|
||||
mi_delay_slot_t slots[MI_RESET_DELAY_SLOTS];
|
||||
} mi_delay_slots_t;
|
||||
|
||||
|
||||
// ------------------------------------------------------
|
||||
// Thread Local data
|
||||
|
@ -411,8 +418,8 @@ typedef struct mi_segment_queue_s {
|
|||
// OS thread local data
|
||||
typedef struct mi_os_tld_s {
|
||||
size_t region_idx; // start point for next allocation
|
||||
mi_stats_t* stats; // points to tld stats
|
||||
mi_delay_slot_t reset_delay[MI_RESET_DELAY_SLOTS];
|
||||
mi_delay_slots_t* reset_delay; // delay slots for OS reset operations
|
||||
mi_stats_t* stats; // points to tld stats
|
||||
} mi_os_tld_t;
|
||||
|
||||
// Segments thread local data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue