| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -131,13 +131,17 @@ void* _mi_arena_meta_zalloc(size_t size, mi_memid_t* memid); | |||
| 131 | 131 | void _mi_arena_meta_free(void* p, mi_memid_t memid, size_t size); | |
| 132 | 132 | ||
| 133 | 133 | typedef struct mi_arena_field_cursor_s { // abstract struct | |
| 134 | - size_t start; | ||
| 135 | - size_t end; | ||
| 136 | - size_t bitmap_idx; | ||
| 137 | - mi_subproc_t* subproc; | ||
| 134 | + size_t os_list_count; // max entries to visit in the OS abandoned list | ||
| 135 | + size_t start; // start arena idx (may need to be wrapped) | ||
| 136 | + size_t end; // end arena idx (exclusive, may need to be wrapped) | ||
| 137 | + size_t bitmap_idx; // current bit idx for an arena | ||
| 138 | + mi_subproc_t* subproc; // only visit blocks in this sub-process | ||
| 139 | + bool visit_all; // ensure all abandoned blocks are seen (blocking) | ||
| 140 | + bool hold_visit_lock; // if the subproc->abandoned_os_visit_lock is held | ||
| 138 | 141 | } mi_arena_field_cursor_t; | |
| 139 | - void _mi_arena_field_cursor_init(mi_heap_t* heap, mi_subproc_t* subproc, mi_arena_field_cursor_t* current); | ||
| 140 | - mi_segment_t* _mi_arena_segment_clear_abandoned_next(mi_arena_field_cursor_t* previous, bool visit_all); | ||
| 142 | + void _mi_arena_field_cursor_init(mi_heap_t* heap, mi_subproc_t* subproc, bool visit_all, mi_arena_field_cursor_t* current); | ||
| 143 | + mi_segment_t* _mi_arena_segment_clear_abandoned_next(mi_arena_field_cursor_t* previous); | ||
| 144 | + void _mi_arena_field_cursor_done(mi_arena_field_cursor_t* current); | ||
| 141 | 145 | ||
| 142 | 146 | // "segment-map.c" | |
| 143 | 147 | void _mi_segment_map_allocated_at(const mi_segment_t* segment); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -613,7 +613,8 @@ void _mi_stat_counter_increase(mi_stat_counter_t* stat, size_t amount); | |||
| 613 | 613 | struct mi_subproc_s { | |
| 614 | 614 | _Atomic(size_t) abandoned_count; // count of abandoned segments for this sub-process | |
| 615 | 615 | _Atomic(size_t) abandoned_os_list_count; // count of abandoned segments in the os-list | |
| 616 | - mi_lock_t abandoned_os_lock; // lock for the abandoned segments outside of arena's | ||
| 616 | + mi_lock_t abandoned_os_lock; // lock for the abandoned os segment list (outside of arena's) (this lock protect list operations) | ||
| 617 | + mi_lock_t abandoned_os_visit_lock; // ensure only one thread per subproc visits the abandoned os list | ||
| 617 | 618 | mi_segment_t* abandoned_os_list; // doubly-linked list of abandoned segments outside of arena's (in OS allocated memory) | |
| 618 | 619 | mi_segment_t* abandoned_os_list_tail; // the tail-end of the list | |
| 619 | 620 | mi_memid_t memid; // provenance of this memory block | |
| Back | FazBrowse Home | New Git URL |
0 commit comments