diff options
author | Andi Gutmans <andi@php.net> | 2001-06-21 21:31:33 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 2001-06-21 21:31:33 +0000 |
commit | 7690887cf6729613cb3de062fe850c435239b127 (patch) | |
tree | 56dc613efb37ab4e54e53650b7704991a9b130a2 | |
parent | 8cd70926c54cf852d16a7842c7926967241118a0 (diff) | |
download | php-git-7690887cf6729613cb3de062fe850c435239b127.tar.gz |
- Use inline instead of macro for PZVAL_LOCK()/PZVAL_UNLOCK() so that it
can be debugged.
-rw-r--r-- | Zend/zend_execute_locks.h | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/Zend/zend_execute_locks.h b/Zend/zend_execute_locks.h index 0be06b0ac4..da389fb519 100644 --- a/Zend/zend_execute_locks.h +++ b/Zend/zend_execute_locks.h @@ -1,21 +1,31 @@ #ifndef ZEND_EXECUTE_LOCKS_H #define ZEND_EXECUTE_LOCKS_H -#define PZVAL_LOCK(z) ((z)->refcount++) -#define PZVAL_UNLOCK(z) { ((z)->refcount--); \ - if (!(z)->refcount) { \ - (z)->refcount = 1; \ - (z)->is_ref = 0; \ - if (EG(garbage_ptr) == 4) { \ - zval_ptr_dtor(&EG(garbage)[0]); \ - zval_ptr_dtor(&EG(garbage)[1]); \ - EG(garbage)[0] = EG(garbage)[2]; \ - EG(garbage)[1] = EG(garbage)[3]; \ - EG(garbage_ptr) -= 2; \ - } \ - EG(garbage)[EG(garbage_ptr)++] = (z); \ - } \ - } +#define PZVAL_LOCK(z) zend_pzval_lock_func(z) + +static inline zend_pzval_lock_func(zval *z) +{ + ((z)->refcount++); +} + +#define PZVAL_UNLOCK(z) zend_pzval_unlock_func(z ELS_CC) + +static inline zend_pzval_unlock_func(zval *z ELS_DC) +{ + ((z)->refcount--); + if (!(z)->refcount) { + (z)->refcount = 1; + (z)->is_ref = 0; + if (EG(garbage_ptr) == 4) { + zval_ptr_dtor(&EG(garbage)[0]); + zval_ptr_dtor(&EG(garbage)[1]); + EG(garbage)[0] = EG(garbage)[2]; + EG(garbage)[1] = EG(garbage)[3]; + EG(garbage_ptr) -= 2; + } + EG(garbage)[EG(garbage_ptr)++] = (z); + } +} #define SELECTIVE_PZVAL_LOCK(pzv, pzn) if (!((pzn)->u.EA.type & EXT_TYPE_UNUSED)) { PZVAL_LOCK(pzv); } |