]> granicus.if.org Git - php/commitdiff
- Clean garbage (delete was nuked a long time ago)
authorZeev Suraski <zeev@php.net>
Tue, 3 Feb 2004 15:37:37 +0000 (15:37 +0000)
committerZeev Suraski <zeev@php.net>
Tue, 3 Feb 2004 15:37:37 +0000 (15:37 +0000)
Zend/zend_execute_API.c
Zend/zend_object_handlers.c
Zend/zend_object_handlers.h
Zend/zend_objects_API.c
Zend/zend_objects_API.h

index 086bde4b276ee4a5716eed9627baa4b8a034b3ba..d99e6dd5c1a09d70ca11a927f1823fc6f76f36c7 100644 (file)
@@ -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 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 */
index 44184bdb29fa781a9498162df2c42849b65e9a3c..415b026b09bd29a0792205b9f045b67deb9fb28f 100644 (file)
@@ -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 */
index b89b6ccc6c748289adf8d8807e4c7b95d387cf73..59a571c6f7d72746858e04106b966f998289077a 100644 (file)
@@ -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;
index c3d5c70efe205fa0eeb8e16e4239bd8cbffcf10a..575fb4e87d9f6799c1480657af0da9dc01428c34 100644 (file)
@@ -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;                                                                                                      \
index 0da3b5e3db21a8d8983804139ed3107e26b0dc90..47489a4c894ac70735183d78b97f1c1cc00adbb3 100644 (file)
@@ -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);