Skip to content

Commit a876577

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Make GC default threshold handling consistent
2 parents a185cc8 + 0fb2374 commit a876577

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Zend/zend_gc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
#define GC_MAX_UNCOMPRESSED (512 * 1024)
178178
#define GC_MAX_BUF_SIZE 0x40000000
179179

180-
#define GC_THRESHOLD_DEFAULT 10000
180+
#define GC_THRESHOLD_DEFAULT (10000 + GC_FIRST_ROOT)
181181
#define GC_THRESHOLD_STEP 10000
182182
#define GC_THRESHOLD_MAX 1000000000
183183
#define GC_THRESHOLD_TRIGGER 100
@@ -501,7 +501,7 @@ ZEND_API zend_bool gc_enable(zend_bool enable)
501501
GC_G(buf) = (gc_root_buffer*) pemalloc(sizeof(gc_root_buffer) * GC_DEFAULT_BUF_SIZE, 1);
502502
GC_G(buf)[0].ref = NULL;
503503
GC_G(buf_size) = GC_DEFAULT_BUF_SIZE;
504-
GC_G(gc_threshold) = GC_THRESHOLD_DEFAULT + GC_FIRST_ROOT;
504+
GC_G(gc_threshold) = GC_THRESHOLD_DEFAULT;
505505
gc_reset();
506506
}
507507
return old_enabled;

0 commit comments

Comments
 (0)