Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ AUTO_CTOR_DTOR = -DAUTO_CTOR_DTOR=1
## Unmap user and bitmap in the destructor. You probably
## don't want this as theres no guarantee the IsoAlloc
## destructor will be called last and other destructors
## that call free will segfault
## may reference objects within these pages
ISO_DTOR_CLEANUP = -DISO_DTOR_CLEANUP=0

## Register a signal handler for SIGSEGV that inspects si_addr
Expand Down
11 changes: 11 additions & 0 deletions src/iso_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1989,9 +1989,20 @@ INTERNAL_HIDDEN void _iso_alloc_destroy(void) {
unmap_guarded_pages(_root->chunk_lookup_table, CHUNK_TO_ZONE_TABLE_SZ);
unmap_guarded_pages(_root->chunk_quarantine, ROUND_UP_PAGE(CHUNK_QUARANTINE_SZ * sizeof(uintptr_t)));
unmap_guarded_pages(zone_cache, ROUND_UP_PAGE(ZONE_CACHE_SZ * sizeof(_tzc)));

#if THREAD_SUPPORT && !USE_SPINLOCK
UNLOCK_BIG_ZONE();
pthread_mutex_destroy(&_root->big_zone_busy_mutex);
#endif

unmap_guarded_pages(_root, sizeof(iso_alloc_root));
#endif
UNLOCK_ROOT();

#if ISO_DTOR_CLEANUP && THREAD_SUPPORT && !USE_SPINLOCK
pthread_mutex_destroy(&sane_cache_mutex);
pthread_mutex_destroy(&root_busy_mutex);
#endif
}

#if UNIT_TESTING
Expand Down