summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2004-02-03 15:37:37 +0000
committerZeev Suraski <zeev@php.net>2004-02-03 15:37:37 +0000
commitc5a7b668cdd79fc575e7c0bc40e676ab272db081 (patch)
treee9f7ef1698ffc601bf9bc43ce7e359a2f6914278
parent871d8bdb573adf22b2e640cb9057b70c9fb9536e (diff)
downloadphp-git-c5a7b668cdd79fc575e7c0bc40e676ab272db081.tar.gz
- Clean garbage (delete was nuked a long time ago)
-rw-r--r--Zend/zend_execute_API.c10
-rw-r--r--Zend/zend_object_handlers.c1
-rw-r--r--Zend/zend_object_handlers.h1
-rw-r--r--Zend/zend_objects_API.c28
-rw-r--r--Zend/zend_objects_API.h2
5 files changed, 12 insertions, 30 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 086bde4b27..d99e6dd5c1 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -238,11 +238,11 @@ void shutdown_executor(TSRMLS_D)
zend_try {
/* Cleanup static data for functions and arrays.
- We need separate cleanup stage because of the following problem:
- Suppose we destroy class X, which destroys function table,
- and in function table we have function foo() that has static $bar. Now if
- object of class X is assigned to $bar, its destructor will be called and will
- fail since X's function table is in mid-destruction.
+ We need a separate cleanup stage because of the following problem:
+ Suppose we destroy class X, which destroys the class's function table,
+ and in the function table we have function foo() that has static $bar.
+ Now if an object of class X is assigned to $bar, its destructor will be
+ called and will fail since X's function table is in mid-destruction.
So we want first of all to clean up all data and then move to tables destruction.
Note that only run-time accessed data need to be cleaned up, pre-defined data can
not contain objects and thus are not probelmatic */
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index 44184bdb29..415b026b09 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -952,7 +952,6 @@ int zend_std_cast_object(zval *readobj, zval *writeobj, int type, int should_fre
ZEND_API zend_object_handlers std_object_handlers = {
zend_objects_store_add_ref, /* add_ref */
zend_objects_store_del_ref, /* del_ref */
- zend_objects_store_delete_obj, /* delete_obj */
zend_objects_clone_obj, /* clone_obj */
zend_std_read_property, /* read_property */
diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h
index b89b6ccc6c..59a571c6f7 100644
--- a/Zend/zend_object_handlers.h
+++ b/Zend/zend_object_handlers.h
@@ -89,7 +89,6 @@ typedef struct _zend_object_handlers {
/* general object functions */
zend_object_add_ref_t add_ref;
zend_object_del_ref_t del_ref;
- zend_object_delete_obj_t delete_obj;
zend_object_clone_obj_t clone_obj;
/* individual object functions */
zend_object_read_property_t read_property;
diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c
index c3d5c70efe..575fb4e87d 100644
--- a/Zend/zend_objects_API.c
+++ b/Zend/zend_objects_API.c
@@ -56,6 +56,12 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TS
}
}
+
+ZEND_API void zend_objects_store_nuke_objects()
+{
+}
+
+
/* Store objects API */
ZEND_API zend_object_handle zend_objects_store_put(void *object, zend_objects_store_dtor_t dtor, zend_objects_store_clone_t clone TSRMLS_DC)
@@ -102,28 +108,6 @@ ZEND_API void zend_objects_store_add_ref(zval *object TSRMLS_DC)
#endif
}
-ZEND_API void zend_objects_store_delete_obj(zval *zobject TSRMLS_DC)
-{
- zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
- struct _store_object *obj = &EG(objects_store).object_buckets[handle].bucket.obj;
-
- if (!EG(objects_store).object_buckets[handle].valid) {
- zend_error(E_ERROR, "Trying to delete invalid object");
- }
-
-
- if (obj->dtor && !EG(objects_store).object_buckets[handle].destructor_called) {
- EG(objects_store).object_buckets[handle].destructor_called = 1;
- obj->dtor(obj->object, handle TSRMLS_CC);
- }
- EG(objects_store).object_buckets[handle].valid = 0;
-
-#if ZEND_DEBUG_OBJECTS
- fprintf(stderr, "Deleted object id #%d\n", handle);
-#endif
-
-}
-
#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; \
diff --git a/Zend/zend_objects_API.h b/Zend/zend_objects_API.h
index 0da3b5e3db..47489a4c89 100644
--- a/Zend/zend_objects_API.h
+++ b/Zend/zend_objects_API.h
@@ -64,7 +64,7 @@ ZEND_API void zend_objects_store_delete_obj(zval *object TSRMLS_DC);
ZEND_API zend_object_value zend_objects_store_clone_obj(zval *object TSRMLS_DC);
ZEND_API void *zend_object_store_get_object(zval *object TSRMLS_DC);
-#define ZEND_OBJECTS_STORE_HANDLERS zend_objects_store_add_ref, zend_objects_store_del_ref, zend_objects_store_delete_obj, zend_objects_store_clone_obj
+#define ZEND_OBJECTS_STORE_HANDLERS zend_objects_store_add_ref, zend_objects_store_del_ref, zend_objects_store_clone_obj
ZEND_API zval **zend_object_create_proxy(zval *object, zval *member TSRMLS_DC);