zval tmp;
ZVAL_OBJ(&tmp, obj);
- ht = get_gc(&tmp, &zv, &n);
+ ht = obj->handlers->get_gc(&tmp, &zv, &n);
end = zv + n;
- if (EXPECTED(!ht)) {
+ if (EXPECTED(!ht) || UNEXPECTED(GC_REF_CHECK_COLOR(ht, GC_BLACK))) {
+ ht = NULL;
if (!n) goto next;
while (!Z_REFCOUNTED_P(--end)) {
if (zv == end) goto next;
zval tmp;
ZVAL_OBJ(&tmp, obj);
- ht = get_gc(&tmp, &zv, &n);
+ ht = obj->handlers->get_gc(&tmp, &zv, &n);
end = zv + n;
- if (EXPECTED(!ht)) {
+ if (EXPECTED(!ht) || UNEXPECTED(GC_REF_CHECK_COLOR(ht, GC_GREY))) {
+ ht = NULL;
if (!n) goto next;
while (!Z_REFCOUNTED_P(--end)) {
if (zv == end) goto next;
zval tmp;
ZVAL_OBJ(&tmp, obj);
- ht = get_gc(&tmp, &zv, &n);
+ ht = obj->handlers->get_gc(&tmp, &zv, &n);
end = zv + n;
- if (EXPECTED(!ht)) {
+ if (EXPECTED(!ht) || UNEXPECTED(!GC_REF_CHECK_COLOR(ht, GC_GREY))) {
+ ht = NULL;
if (!n) goto next;
while (!Z_REFCOUNTED_P(--end)) {
if (zv == end) goto next;
*flags |= GC_HAS_DESTRUCTORS;
}
ZVAL_OBJ(&tmp, obj);
- ht = get_gc(&tmp, &zv, &n);
+ ht = obj->handlers->get_gc(&tmp, &zv, &n);
end = zv + n;
- if (EXPECTED(!ht)) {
+ if (EXPECTED(!ht) || UNEXPECTED(GC_REF_CHECK_COLOR(ht, GC_BLACK))) {
+ ht = NULL;
if (!n) goto next;
while (!Z_REFCOUNTED_P(--end)) {
/* count non-refcounted for compatibility ??? */