mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
fix potential A-B-A problem with segment abandonment; noticed by Manual Poeter and Sam Gross
This commit is contained in:
parent
5d2f111f64
commit
683d8998d4
3 changed files with 60 additions and 28 deletions
|
@ -234,7 +234,7 @@ typedef struct mi_segment_s {
|
|||
// segment fields
|
||||
struct mi_segment_s* next; // must be the first segment field -- see `segment.c:segment_alloc`
|
||||
struct mi_segment_s* prev;
|
||||
volatile _Atomic(struct mi_segment_s*) abandoned_next;
|
||||
struct mi_segment_s* abandoned_next;
|
||||
size_t abandoned; // abandoned pages (i.e. the original owning thread stopped) (`abandoned <= used`)
|
||||
size_t used; // count of pages in use (`used <= capacity`)
|
||||
size_t capacity; // count of available pages (`#free + used`)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue