File tree Expand file tree Collapse file tree 1 file changed +28
-10
lines changed
Expand file tree Collapse file tree 1 file changed +28
-10
lines changed Original file line number Diff line number Diff line change @@ -97,17 +97,35 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_free_object_storage(zend_objects_
9797 end = objects -> object_buckets + 1 ;
9898 obj_ptr = objects -> object_buckets + objects -> top ;
9999
100- do {
101- obj_ptr -- ;
102- obj = * obj_ptr ;
103- if (IS_OBJ_VALID (obj )) {
104- if (!(OBJ_FLAGS (obj ) & IS_OBJ_FREE_CALLED )) {
105- GC_ADD_FLAGS (obj , IS_OBJ_FREE_CALLED );
106- GC_ADDREF (obj );
107- obj -> handlers -> free_obj (obj );
100+ if (fast_shutdown ) {
101+ do {
102+ obj_ptr -- ;
103+ obj = * obj_ptr ;
104+ if (IS_OBJ_VALID (obj )) {
105+ if (!(OBJ_FLAGS (obj ) & IS_OBJ_FREE_CALLED )) {
106+ GC_ADD_FLAGS (obj , IS_OBJ_FREE_CALLED );
107+ if (obj -> handlers -> free_obj != zend_object_std_dtor
108+ || OBJ_FLAGS (obj ) & IS_OBJ_WEAKLY_REFERENCED
109+ ) {
110+ GC_ADDREF (obj );
111+ obj -> handlers -> free_obj (obj );
112+ }
113+ }
108114 }
109- }
110- } while (obj_ptr != end );
115+ } while (obj_ptr != end );
116+ } else {
117+ do {
118+ obj_ptr -- ;
119+ obj = * obj_ptr ;
120+ if (IS_OBJ_VALID (obj )) {
121+ if (!(OBJ_FLAGS (obj ) & IS_OBJ_FREE_CALLED )) {
122+ GC_ADD_FLAGS (obj , IS_OBJ_FREE_CALLED );
123+ GC_ADDREF (obj );
124+ obj -> handlers -> free_obj (obj );
125+ }
126+ }
127+ } while (obj_ptr != end );
128+ }
111129}
112130
113131
You can’t perform that action at this time.
0 commit comments