File tree Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -1008,6 +1008,9 @@ ZEND_API void execute(zend_op_array *op_array ELS_DC)
1008
1008
zend_timeout (0 );
1009
1009
}
1010
1010
#endif
1011
+
1012
+ zend_clean_garbage (ELS_C );
1013
+
1011
1014
switch (opline -> opcode ) {
1012
1015
case ZEND_ADD :
1013
1016
EG (binary_op ) = add_function ;
Original file line number Diff line number Diff line change @@ -13,18 +13,18 @@ static inline zend_pzval_lock_func(zval *z)
13
13
static inline zend_pzval_unlock_func (zval * z ELS_DC )
14
14
{
15
15
((z )-> refcount -- );
16
- if (!(z )-> refcount ) {
17
- (z )-> refcount = 1 ;
18
- (z )-> is_ref = 0 ;
19
- if ( EG (garbage_ptr ) == 4 ) {
20
- zval_ptr_dtor ( & EG ( garbage )[ 0 ]);
21
- zval_ptr_dtor ( & EG ( garbage )[ 1 ]);
22
- EG ( garbage )[ 0 ] = EG ( garbage )[ 2 ];
23
- EG ( garbage )[ 1 ] = EG ( garbage )[ 3 ];
24
- EG ( garbage_ptr ) -= 2 ;
25
- }
26
- EG (garbage )[EG (garbage_ptr )++ ] = ( z );
27
- }
16
+ if (!(z )-> refcount ) {
17
+ (z )-> refcount = 1 ;
18
+ (z )-> is_ref = 0 ;
19
+ EG ( garbage )[ EG (garbage_ptr )++ ] = ( z );
20
+ }
21
+ }
22
+
23
+ static inline zend_clean_garbage ( ELS_D )
24
+ {
25
+ while ( EG ( garbage_ptr )) {
26
+ zval_ptr_dtor ( & EG (garbage )[-- EG (garbage_ptr )]);
27
+ }
28
28
}
29
29
30
30
#define SELECTIVE_PZVAL_LOCK (pzv , pzn ) if (!((pzn)->u.EA.type & EXT_TYPE_UNUSED)) { PZVAL_LOCK(pzv); }
Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ struct _zend_executor_globals {
181
181
int (*unary_op)(zval *result, zval *op1);
182
182
int (*binary_op)(zval *result, zval *op1, zval *op2);
183
183
184
- zval *garbage[4 ];
184
+ zval *garbage[2 ];
185
185
int garbage_ptr;
186
186
187
187
zval *user_error_handler;
You can’t perform that action at this time.
0 commit comments