mirror of https://github.com/microsoft/mimalloc
don't reset a segment thread id when iterating
This commit is contained in:
parent
537c51e227
commit
065f46cefb
|
@ -82,7 +82,10 @@ static bool mi_arena_segment_os_clear_abandoned(mi_segment_t* segment, bool take
|
|||
segment->abandoned_os_prev = NULL;
|
||||
mi_atomic_decrement_relaxed(&subproc->abandoned_count);
|
||||
mi_atomic_decrement_relaxed(&subproc->abandoned_os_list_count);
|
||||
mi_atomic_store_release(&segment->thread_id, _mi_thread_id());
|
||||
if (take_lock) {
|
||||
// don't set the thread_id when iterating
|
||||
mi_atomic_store_release(&segment->thread_id, _mi_thread_id());
|
||||
}
|
||||
reclaimed = true;
|
||||
}
|
||||
if (take_lock) { mi_lock_release(&segment->subproc->abandoned_os_lock); }
|
||||
|
|
|
@ -836,6 +836,7 @@ void _mi_segment_page_abandon(mi_page_t* page, mi_segments_tld_t* tld) {
|
|||
// Possibly clear pages and check if free space is available
|
||||
static bool mi_segment_check_free(mi_segment_t* segment, size_t block_size, bool* all_pages_free)
|
||||
{
|
||||
mi_assert_internal(mi_atomic_load_relaxed(&segment->thread_id) == 0);
|
||||
bool has_page = false;
|
||||
size_t pages_used = 0;
|
||||
size_t pages_used_empty = 0;
|
||||
|
|
Loading…
Reference in New Issue