Handle large allocations in separate segments

This commit is contained in:
Sergiy Kuryata 2024-12-05 19:44:52 -08:00
parent a9bd3205be
commit d19f103ea3
4 changed files with 64 additions and 31 deletions

View file

@ -453,6 +453,7 @@ typedef struct mi_segment_s {
mi_memid_t memid; // memory id for arena/OS allocation
bool allow_decommit; // can we decommmit the memory
bool allow_purge; // can we purge the memory (reset or decommit)
bool is_for_large_pages; // this should be part of segment_kind; indicates if segment is used to allocate large pages
size_t segment_size;
// segment fields
@ -703,6 +704,7 @@ typedef struct mi_os_tld_s {
// Segments thread local data
typedef struct mi_segments_tld_s {
mi_span_queue_t spans[MI_SEGMENT_BIN_MAX+1]; // free slice spans inside segments
mi_span_queue_t large_spans[MI_SEGMENT_BIN_MAX+1]; // free slice spans inside large segments
size_t count; // current number of segments;
size_t peak_count; // peak number of segments
size_t current_size; // current size of all segments