File tree Expand file tree Collapse file tree 1 file changed +25
-15
lines changed Expand file tree Collapse file tree 1 file changed +25
-15
lines changed Original file line number Diff line number Diff line change 1
1
#ifndef ZEND_EXECUTE_LOCKS_H
2
2
#define ZEND_EXECUTE_LOCKS_H
3
3
4
- #define PZVAL_LOCK (z ) ((z)->refcount++)
5
- #define PZVAL_UNLOCK (z ) { ((z)->refcount--); \
6
- if (!(z)->refcount) { \
7
- (z)->refcount = 1; \
8
- (z)->is_ref = 0; \
9
- if (EG(garbage_ptr) == 4) { \
10
- zval_ptr_dtor(&EG(garbage)[0]); \
11
- zval_ptr_dtor(&EG(garbage)[1]); \
12
- EG(garbage)[0] = EG(garbage)[2]; \
13
- EG(garbage)[1] = EG(garbage)[3]; \
14
- EG(garbage_ptr) -= 2; \
15
- } \
16
- EG(garbage)[EG(garbage_ptr)++] = (z); \
17
- } \
18
- }
4
+ #define PZVAL_LOCK (z ) zend_pzval_lock_func(z)
5
+
6
+ static inline zend_pzval_lock_func (zval * z )
7
+ {
8
+ ((z )-> refcount ++ );
9
+ }
10
+
11
+ #define PZVAL_UNLOCK (z ) zend_pzval_unlock_func(z ELS_CC)
12
+
13
+ static inline zend_pzval_unlock_func (zval * z ELS_DC )
14
+ {
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
+ }
28
+ }
19
29
20
30
#define SELECTIVE_PZVAL_LOCK (pzv , pzn ) if (!((pzn)->u.EA.type & EXT_TYPE_UNUSED)) { PZVAL_LOCK(pzv); }
21
31
You can’t perform that action at this time.
0 commit comments