2000-07-03 07:54:19 +08:00
|
|
|
#ifndef ZEND_EXECUTE_LOCKS_H
|
|
|
|
#define ZEND_EXECUTE_LOCKS_H
|
2000-02-02 06:04:52 +08:00
|
|
|
|
2001-06-22 05:31:33 +08:00
|
|
|
#define PZVAL_LOCK(z) zend_pzval_lock_func(z)
|
|
|
|
|
2001-06-29 07:40:44 +08:00
|
|
|
static inline void zend_pzval_lock_func(zval *z)
|
2001-06-22 05:31:33 +08:00
|
|
|
{
|
2001-09-01 05:47:26 +08:00
|
|
|
z->refcount++;
|
2001-06-22 05:31:33 +08:00
|
|
|
}
|
|
|
|
|
2001-07-27 18:10:39 +08:00
|
|
|
#define PZVAL_UNLOCK(z) zend_pzval_unlock_func(z TSRMLS_CC)
|
2001-06-22 05:31:33 +08:00
|
|
|
|
2001-07-27 18:10:39 +08:00
|
|
|
static inline void zend_pzval_unlock_func(zval *z TSRMLS_DC)
|
2001-06-22 05:31:33 +08:00
|
|
|
{
|
2001-09-01 05:47:26 +08:00
|
|
|
z->refcount--;
|
|
|
|
if (!z->refcount) {
|
|
|
|
z->refcount = 1;
|
|
|
|
z->is_ref = 0;
|
|
|
|
EG(garbage)[EG(garbage_ptr)++] = z;
|
2001-06-22 06:30:23 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-07-27 18:10:39 +08:00
|
|
|
static inline void zend_clean_garbage(TSRMLS_D)
|
2001-06-22 06:30:23 +08:00
|
|
|
{
|
|
|
|
while (EG(garbage_ptr)) {
|
|
|
|
zval_ptr_dtor(&EG(garbage)[--EG(garbage_ptr)]);
|
|
|
|
}
|
2001-06-22 05:31:33 +08:00
|
|
|
}
|
2000-02-02 06:04:52 +08:00
|
|
|
|
|
|
|
#define SELECTIVE_PZVAL_LOCK(pzv, pzn) if (!((pzn)->u.EA.type & EXT_TYPE_UNUSED)) { PZVAL_LOCK(pzv); }
|
|
|
|
|
2000-07-03 07:54:19 +08:00
|
|
|
#endif /* ZEND_EXECUTE_LOCKS_H */
|