add assert for segment purges

This commit is contained in:
Daan 2024-04-19 12:44:23 -07:00
parent bf5932c3c6
commit 09e91ec911
1 changed files with 6 additions and 0 deletions

View File

@ -518,6 +518,12 @@ static void mi_segment_os_free(mi_segment_t* segment, size_t segment_size, mi_se
// called from `heap_collect`.
void _mi_segments_collect(bool force, mi_segments_tld_t* tld) {
mi_pages_try_purge(force,tld);
#if MI_DEBUG>=2
if (!_mi_is_main_thread()) {
mi_assert_internal(tld->pages_purge.first == NULL);
mi_assert_internal(tld->pages_purge.last == NULL);
}
#endif
}