ZVAL_OBJ(&tmp, obj);
ht = get_gc(&tmp, &zv, &n);
end = zv + n;
- if (EXPECTED(!ht)) {
- if (EXPECTED(!ht) || UNEXPECTED(GC_REF_GET_COLOR(ht) == GC_BLACK)) {
++ if (EXPECTED(!ht) || UNEXPECTED(GC_REF_CHECK_COLOR(ht, GC_BLACK))) {
+ ht = NULL;
- if (!n) return;
+ if (!n) goto next;
while (!Z_REFCOUNTED_P(--end)) {
- if (zv == end) return;
+ if (zv == end) goto next;
}
+ } else {
+ GC_REF_SET_BLACK(ht);
}
while (zv != end) {
if (Z_REFCOUNTED_P(zv)) {
ZVAL_OBJ(&tmp, obj);
ht = get_gc(&tmp, &zv, &n);
end = zv + n;
- if (EXPECTED(!ht)) {
- if (EXPECTED(!ht) || UNEXPECTED(GC_REF_GET_COLOR(ht) == GC_GREY)) {
++ if (EXPECTED(!ht) || UNEXPECTED(GC_REF_CHECK_COLOR(ht, GC_GREY))) {
+ ht = NULL;
- if (!n) return;
+ if (!n) goto next;
while (!Z_REFCOUNTED_P(--end)) {
- if (zv == end) return;
+ if (zv == end) goto next;
}
+ } else {
+ GC_REF_SET_COLOR(ht, GC_GREY);
}
while (zv != end) {
if (Z_REFCOUNTED_P(zv)) {
ZVAL_OBJ(&tmp, obj);
ht = get_gc(&tmp, &zv, &n);
end = zv + n;
- if (EXPECTED(!ht)) {
- if (EXPECTED(!ht) || UNEXPECTED(GC_REF_GET_COLOR(ht) != GC_GREY)) {
++ if (EXPECTED(!ht) || UNEXPECTED(!GC_REF_CHECK_COLOR(ht, GC_GREY))) {
+ ht = NULL;
- if (!n) return;
+ if (!n) goto next;
while (!Z_REFCOUNTED_P(--end)) {
- if (zv == end) return;
+ if (zv == end) goto next;
}
+ } else {
+ GC_REF_SET_COLOR(ht, GC_WHITE);
}
while (zv != end) {
if (Z_REFCOUNTED_P(zv)) {
ZVAL_OBJ(&tmp, obj);
ht = get_gc(&tmp, &zv, &n);
end = zv + n;
- if (EXPECTED(!ht)) {
- if (EXPECTED(!ht) || UNEXPECTED(GC_REF_GET_COLOR(ht) == GC_BLACK)) {
++ if (EXPECTED(!ht) || UNEXPECTED(GC_REF_CHECK_COLOR(ht, GC_BLACK))) {
+ ht = NULL;
- if (!n) return count;
+ 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) return count;
+ if (zv == end) goto next;
}
+ } else {
+ GC_REF_SET_BLACK(ht);
}
while (zv != end) {
if (Z_REFCOUNTED_P(zv)) {