File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 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+ gc_collect_cycles ();
19+ ?>
20+ ==DONE==
21+ --EXPECT--
22+ ==DONE==
Original file line number Diff line number Diff line change @@ -718,7 +718,7 @@ static void ZEND_FASTCALL gc_extra_root(zend_refcounted *ref)
718718
719719 if (EXPECTED (GC_HAS_UNUSED ())) {
720720 idx = GC_FETCH_UNUSED ();
721- } else if (EXPECTED (GC_HAS_NEXT_UNUSED_UNDER_THRESHOLD ())) {
721+ } else if (EXPECTED (GC_HAS_NEXT_UNUSED ())) {
722722 idx = GC_FETCH_NEXT_UNUSED ();
723723 } else {
724724 gc_grow_root_buffer ();
You can’t perform that action at this time.
0 commit comments