zend_bool old_enabled = GC_G(gc_enabled);
GC_G(gc_enabled) = enable;
if (enable && !old_enabled && GC_G(buf) == NULL) {
- GC_G(buf) = (gc_root_buffer*) malloc(sizeof(gc_root_buffer) * GC_DEFAULT_BUF_SIZE);
+ GC_G(buf) = (gc_root_buffer*) pemalloc(sizeof(gc_root_buffer) * GC_DEFAULT_BUF_SIZE, 1);
+ GC_G(buf)[0].ref = NULL;
GC_G(buf_size) = GC_DEFAULT_BUF_SIZE;
GC_G(gc_threshold) = GC_THRESHOLD_DEFAULT + GC_FIRST_ROOT;
gc_reset();
gc_root_buffer *root;
uint32_t idx = GC_REF_ADDRESS(ref);
- ZEND_ASSERT(idx);
-
GC_BENCH_INC(zval_remove_from_buffer);
if (!GC_REF_CHECK_COLOR(ref, GC_BLACK)) {
return;
}
+ ZEND_ASSERT(idx);
root = GC_IDX2PTR(idx);
gc_remove_from_roots(root);
}