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 6a3c083 commit 6b57e2dCopy full SHA for 6b57e2d
Zend/tests/gh13569.phpt
@@ -0,0 +1,22 @@
1
+--TEST--
2
+GH-13569: GC buffer grows up to GC_MAX_BUF_SIZE when scanning WeakMaps
3
+--FILE--
4
+<?php
5
+
6
+$wm = new WeakMap();
7
+$objs = [];
8
+for ($i = 0; $i < 30_000; $i++) {
9
+ $objs[] = $obj = new stdClass;
10
+ $wm[$obj] = $obj;
11
+}
12
13
+gc_collect_cycles();
14
15
+$tmp = $wm;
16
+$tmp = null;
17
18
19
+?>
20
+==DONE==
21
+--EXPECT--
22
Zend/zend_gc.c
@@ -718,7 +718,7 @@ static void ZEND_FASTCALL gc_extra_root(zend_refcounted *ref)
718
719
if (EXPECTED(GC_HAS_UNUSED())) {
720
idx = GC_FETCH_UNUSED();
721
- } else if (EXPECTED(GC_HAS_NEXT_UNUSED_UNDER_THRESHOLD())) {
+ } else if (EXPECTED(GC_HAS_NEXT_UNUSED())) {
722
idx = GC_FETCH_NEXT_UNUSED();
723
} else {
724
gc_grow_root_buffer();
0 commit comments