mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-07 11:58:41 +03:00
ensure forced abandoned pages can be accessed after free
This commit is contained in:
parent
9b7ac9a1a6
commit
7673aa2517
3 changed files with 26 additions and 21 deletions
|
@ -411,10 +411,8 @@ void _mi_page_force_abandon(mi_page_t* page) {
|
|||
|
||||
// ensure this page is no longer in the heap delayed free list
|
||||
_mi_heap_delayed_free_all(heap);
|
||||
// TODO: can we still access the page as it may have been
|
||||
// freed and the memory decommitted?
|
||||
// A way around this is to explicitly unlink this page from
|
||||
// the heap delayed free list.
|
||||
// We can still access the page meta-info even if it is freed as we ensure
|
||||
// in `mi_segment_force_abandon` that the segment is not freed (yet)
|
||||
if (page->capacity == 0) return; // it may have been freed now
|
||||
|
||||
// and now unlink it from the page queue and abandon (or free)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue