mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
everted (this part was committed by mistake)
This commit is contained in:
parent
f4dc0f293d
commit
caee59b856
1 changed files with 13 additions and 13 deletions
|
@ -158,7 +158,8 @@ ZEND_API void zend_objects_store_add_ref_by_handle(zend_object_handle handle TSR
|
|||
|
||||
#define ZEND_OBJECTS_STORE_ADD_TO_FREE_LIST() \
|
||||
EG(objects_store).object_buckets[handle].bucket.free_list.next = EG(objects_store).free_list_head; \
|
||||
EG(objects_store).free_list_head = handle;
|
||||
EG(objects_store).free_list_head = handle; \
|
||||
EG(objects_store).object_buckets[handle].valid = 0;
|
||||
|
||||
ZEND_API void zend_objects_store_del_ref(zval *zobject TSRMLS_DC)
|
||||
{
|
||||
|
@ -185,12 +186,13 @@ ZEND_API void zend_objects_store_del_ref_by_handle(zend_object_handle handle TSR
|
|||
return;
|
||||
}
|
||||
|
||||
obj = &EG(objects_store).object_buckets[handle].bucket.obj;
|
||||
|
||||
/* Make sure we hold a reference count during the destructor call
|
||||
otherwise, when the destructor ends the storage might be freed
|
||||
when the refcount reaches 0 a second time
|
||||
*/
|
||||
if (EG(objects_store).object_buckets[handle].valid) {
|
||||
obj = &EG(objects_store).object_buckets[handle].bucket.obj;
|
||||
if (obj->refcount == 1) {
|
||||
if (!EG(objects_store).object_buckets[handle].destructor_called) {
|
||||
EG(objects_store).object_buckets[handle].destructor_called = 1;
|
||||
|
@ -204,7 +206,6 @@ ZEND_API void zend_objects_store_del_ref_by_handle(zend_object_handle handle TSR
|
|||
}
|
||||
}
|
||||
if (obj->refcount == 1) {
|
||||
EG(objects_store).object_buckets[handle].valid = 0;
|
||||
GC_REMOVE_ZOBJ_FROM_BUFFER(obj);
|
||||
if (obj->free_storage) {
|
||||
zend_try {
|
||||
|
@ -216,6 +217,7 @@ ZEND_API void zend_objects_store_del_ref_by_handle(zend_object_handle handle TSR
|
|||
ZEND_OBJECTS_STORE_ADD_TO_FREE_LIST();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
obj->refcount--;
|
||||
|
||||
|
@ -226,11 +228,9 @@ ZEND_API void zend_objects_store_del_ref_by_handle(zend_object_handle handle TSR
|
|||
fprintf(stderr, "Decreased refcount of object id #%d\n", handle);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (failure) {
|
||||
zend_bailout();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ZEND_API zend_object_value zend_objects_store_clone_obj(zval *zobject TSRMLS_DC)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue