Skip to content

Commit 4dd7237

Browse files
committed
Add comment
1 parent 491940e commit 4dd7237

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Zend/zend_alloc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,6 +2356,7 @@ static zend_mm_heap *zend_mm_init(void)
23562356
return heap;
23572357
}
23582358

2359+
// heap must be unpoisoned when entering, must remain unpoisoned before leaving
23592360
static size_t _zend_mm_gc(zend_mm_heap *heap)
23602361
{
23612362
zend_mm_free_slot *p, *q;
@@ -2372,6 +2373,10 @@ static size_t _zend_mm_gc(zend_mm_heap *heap)
23722373
size_t (*gc)(void) = heap->custom_heap._gc;
23732374
if (gc) {
23742375
size_t ret = gc();
2376+
// Unpoison to handle re-entrant calls
2377+
// i.e. via the tracked allocator, which
2378+
// re-invokes the ZEND_API zend_mm_gc which
2379+
// poisons the heap before exiting.
23752380
ZEND_MM_UNPOISON_HEAP(heap);
23762381
return ret;
23772382
}

0 commit comments

Comments
 (0)