diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-08-13 12:08:59 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-08-13 12:08:59 +0200 |
commit | f0f3fe0b6c2eb93ff01058f389e6ae2a93ea20d4 (patch) | |
tree | 6c187013ba354b6eb0eed931a996e927d7c8cd21 /Zend | |
parent | 7bd2b9d2e6ae5ab85f01311fab585b0e4e56acd4 (diff) | |
download | php-git-f0f3fe0b6c2eb93ff01058f389e6ae2a93ea20d4.tar.gz |
Don't include non-refcounted structures in GC count
Diffstat (limited to 'Zend')
-rw-r--r-- | Zend/tests/gc_017.phpt | 4 | ||||
-rw-r--r-- | Zend/tests/gc_033.phpt | 2 | ||||
-rw-r--r-- | Zend/zend_gc.c | 14 |
3 files changed, 3 insertions, 17 deletions
diff --git a/Zend/tests/gc_017.phpt b/Zend/tests/gc_017.phpt index a1a8c3eaf6..102c2b6bcb 100644 --- a/Zend/tests/gc_017.phpt +++ b/Zend/tests/gc_017.phpt @@ -31,12 +31,12 @@ $a->insert($c); unset($a); unset($b); unset($c); -var_dump(gc_collect_cycles() >= 7); +var_dump(gc_collect_cycles()); echo "ok\n" ?> --EXPECTF-- string(1) "%s" string(1) "%s" string(1) "%s" -bool(true) +int(4) ok diff --git a/Zend/tests/gc_033.phpt b/Zend/tests/gc_033.phpt index 2db10196ad..1fd36976ad 100644 --- a/Zend/tests/gc_033.phpt +++ b/Zend/tests/gc_033.phpt @@ -27,4 +27,4 @@ for ($i=0; $i<9999; $i++) { var_dump(gc_collect_cycles()); ?> --EXPECT-- -int(20001) +int(10002) diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c index 7ff1412ad6..199387643d 100644 --- a/Zend/zend_gc.c +++ b/Zend/zend_gc.c @@ -1183,10 +1183,6 @@ static int gc_collect_white(zend_refcounted *ref, uint32_t *flags, gc_stack *sta ht = NULL; if (!n) goto next; while (!Z_REFCOUNTED_P(--end)) { - /* count non-refcounted for compatibility ??? */ - if (Z_TYPE_P(zv) != IS_UNDEF) { - count++; - } if (zv == end) goto next; } } else { @@ -1200,9 +1196,6 @@ static int gc_collect_white(zend_refcounted *ref, uint32_t *flags, gc_stack *sta GC_REF_SET_BLACK(ref); GC_STACK_PUSH(ref); } - /* count non-refcounted for compatibility ??? */ - } else if (Z_TYPE_P(zv) != IS_UNDEF) { - count++; } zv++; } @@ -1250,10 +1243,6 @@ static int gc_collect_white(zend_refcounted *ref, uint32_t *flags, gc_stack *sta if (Z_REFCOUNTED_P(zv)) { break; } - /* count non-refcounted for compatibility ??? */ - if (Z_TYPE_P(zv) != IS_UNDEF) { - count++; - } if (p == end) goto next; } while (p != end) { @@ -1268,9 +1257,6 @@ static int gc_collect_white(zend_refcounted *ref, uint32_t *flags, gc_stack *sta GC_REF_SET_BLACK(ref); GC_STACK_PUSH(ref); } - /* count non-refcounted for compatibility ??? */ - } else if (Z_TYPE_P(zv) != IS_UNDEF) { - count++; } p++; } |