mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fixed GC bug
This commit is contained in:
parent
d1f40f7439
commit
88bf6d2e16
1 changed files with 23 additions and 19 deletions
|
@ -414,7 +414,8 @@ static void gc_mark_roots(TSRMLS_D)
|
||||||
gc_root_buffer *current = GC_G(roots).next;
|
gc_root_buffer *current = GC_G(roots).next;
|
||||||
|
|
||||||
while (current != &GC_G(roots)) {
|
while (current != &GC_G(roots)) {
|
||||||
if (current->handle && EG(objects_store).object_buckets) {
|
if (current->handle) {
|
||||||
|
if (EG(objects_store).object_buckets) {
|
||||||
struct _store_object *obj = &EG(objects_store).object_buckets[current->handle].bucket.obj;
|
struct _store_object *obj = &EG(objects_store).object_buckets[current->handle].bucket.obj;
|
||||||
|
|
||||||
if (GC_GET_COLOR(obj->buffered) == GC_PURPLE) {
|
if (GC_GET_COLOR(obj->buffered) == GC_PURPLE) {
|
||||||
|
@ -428,6 +429,7 @@ static void gc_mark_roots(TSRMLS_D)
|
||||||
GC_SET_ADDRESS(obj->buffered, NULL);
|
GC_SET_ADDRESS(obj->buffered, NULL);
|
||||||
GC_REMOVE_FROM_BUFFER(current);
|
GC_REMOVE_FROM_BUFFER(current);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (GC_ZVAL_GET_COLOR(current->u.pz) == GC_PURPLE) {
|
if (GC_ZVAL_GET_COLOR(current->u.pz) == GC_PURPLE) {
|
||||||
zval_mark_grey(current->u.pz TSRMLS_CC);
|
zval_mark_grey(current->u.pz TSRMLS_CC);
|
||||||
|
@ -623,7 +625,8 @@ static void gc_collect_roots(TSRMLS_D)
|
||||||
gc_root_buffer *current = GC_G(roots).next;
|
gc_root_buffer *current = GC_G(roots).next;
|
||||||
|
|
||||||
while (current != &GC_G(roots)) {
|
while (current != &GC_G(roots)) {
|
||||||
if (current->handle && EG(objects_store).object_buckets) {
|
if (current->handle) {
|
||||||
|
if (EG(objects_store).object_buckets) {
|
||||||
struct _store_object *obj = &EG(objects_store).object_buckets[current->handle].bucket.obj;
|
struct _store_object *obj = &EG(objects_store).object_buckets[current->handle].bucket.obj;
|
||||||
zval z;
|
zval z;
|
||||||
|
|
||||||
|
@ -632,6 +635,7 @@ static void gc_collect_roots(TSRMLS_D)
|
||||||
Z_OBJ_HANDLE(z) = current->handle;
|
Z_OBJ_HANDLE(z) = current->handle;
|
||||||
Z_OBJ_HT(z) = current->u.handlers;
|
Z_OBJ_HT(z) = current->u.handlers;
|
||||||
zobj_collect_white(&z TSRMLS_CC);
|
zobj_collect_white(&z TSRMLS_CC);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
GC_ZVAL_SET_ADDRESS(current->u.pz, NULL);
|
GC_ZVAL_SET_ADDRESS(current->u.pz, NULL);
|
||||||
zval_collect_white(current->u.pz TSRMLS_CC);
|
zval_collect_white(current->u.pz TSRMLS_CC);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue