We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 491940e commit 4dd7237Copy full SHA for 4dd7237
Zend/zend_alloc.c
@@ -2356,6 +2356,7 @@ static zend_mm_heap *zend_mm_init(void)
2356
return heap;
2357
}
2358
2359
+// heap must be unpoisoned when entering, must remain unpoisoned before leaving
2360
static size_t _zend_mm_gc(zend_mm_heap *heap)
2361
{
2362
zend_mm_free_slot *p, *q;
@@ -2372,6 +2373,10 @@ static size_t _zend_mm_gc(zend_mm_heap *heap)
2372
2373
size_t (*gc)(void) = heap->custom_heap._gc;
2374
if (gc) {
2375
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.
2380
ZEND_MM_UNPOISON_HEAP(heap);
2381
return ret;
2382
0 commit comments