Skip to content

Commit 123dcc5

Browse files
committed
Simplify more
1 parent 1ae410e commit 123dcc5

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Zend/zend_gc.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ static void gc_scan_black(zend_refcounted *ref, gc_stack *stack)
10441044
* counts and mark visited nodes grey. See MarkGray() in Bacon & Rajan. */
10451045
static void gc_mark_grey(zend_refcounted *ref, gc_stack *stack)
10461046
{
1047-
HashTable *ht, *zvals_ht = NULL;
1047+
HashTable *ht, *primitive_ht = NULL;
10481048
Bucket *p;
10491049
zval *zv;
10501050
uint32_t n;
@@ -1135,7 +1135,7 @@ static void gc_mark_grey(zend_refcounted *ref, gc_stack *stack)
11351135
handle_zvals:
11361136
for (; n != 0; n--) {
11371137
if (Z_COLLECTABLE_P(zv)) {
1138-
zvals_ht = NULL;
1138+
primitive_ht = NULL;
11391139
ref = Z_COUNTED_P(zv);
11401140
GC_DELREF(ref);
11411141
if (!GC_REF_CHECK_COLOR(ref, GC_GREY)) {
@@ -1157,9 +1157,9 @@ static void gc_mark_grey(zend_refcounted *ref, gc_stack *stack)
11571157
}
11581158
zv++;
11591159
}
1160-
if (zvals_ht) {
1161-
GC_ADD_FLAGS(zvals_ht, GC_NOT_COLLECTABLE);
1162-
zvals_ht = NULL;
1160+
if (primitive_ht) {
1161+
GC_ADD_FLAGS(primitive_ht, GC_NOT_COLLECTABLE);
1162+
primitive_ht = NULL;
11631163
}
11641164
}
11651165
} else if (GC_TYPE(ref) == IS_ARRAY) {
@@ -1170,21 +1170,20 @@ static void gc_mark_grey(zend_refcounted *ref, gc_stack *stack)
11701170
if (GC_FLAGS(ht) & GC_NOT_COLLECTABLE) {
11711171
goto next;
11721172
}
1173+
primitive_ht = ht;
11731174
if (HT_IS_PACKED(ht)) {
11741175
zv = ht->arPacked;
1175-
zvals_ht = ht;
11761176
goto handle_zvals;
11771177
}
11781178

1179-
bool is_primitive = true;
11801179
p = ht->arData;
11811180
for (; n != 0; n--) {
11821181
zv = &p->val;
11831182
if (Z_TYPE_P(zv) == IS_INDIRECT) {
11841183
zv = Z_INDIRECT_P(zv);
11851184
}
11861185
if (Z_COLLECTABLE_P(zv)) {
1187-
is_primitive = false;
1186+
primitive_ht = NULL;
11881187
ref = Z_COUNTED_P(zv);
11891188
GC_DELREF(ref);
11901189
if (!GC_REF_CHECK_COLOR(ref, GC_GREY)) {
@@ -1210,8 +1209,9 @@ static void gc_mark_grey(zend_refcounted *ref, gc_stack *stack)
12101209
}
12111210
p++;
12121211
}
1213-
if (is_primitive) {
1212+
if (primitive_ht) {
12141213
GC_ADD_FLAGS(ht, GC_NOT_COLLECTABLE);
1214+
primitive_ht = NULL;
12151215
}
12161216
} else if (GC_TYPE(ref) == IS_REFERENCE) {
12171217
if (Z_COLLECTABLE(((zend_reference*)ref)->val)) {

0 commit comments

Comments
 (0)