2003-02-01 01:49:15 +00:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Zend Engine |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Copyright (c) 1998-2003 Zend Technologies Ltd. (http://www.zend.com) |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| This source file is subject to version 2.00 of the Zend license, |
|
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
|
|
|
| available at through the world-wide-web at |
|
|
|
|
| http://www.zend.com/license/2_00.txt. |
|
|
|
|
| If you did not receive a copy of the Zend license and are unable to |
|
|
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
|
|
| license@zend.com so we can mail you a copy immediately. |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Authors: Andi Gutmans <andi@zend.com> |
|
|
|
|
| Zeev Suraski <zeev@zend.com> |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
2000-07-02 23:54:19 +00:00
|
|
|
#ifndef ZEND_EXECUTE_LOCKS_H
|
|
|
|
#define ZEND_EXECUTE_LOCKS_H
|
2000-02-01 22:04:52 +00:00
|
|
|
|
2001-06-21 21:31:33 +00:00
|
|
|
#define PZVAL_LOCK(z) zend_pzval_lock_func(z)
|
|
|
|
|
2001-06-28 23:40:44 +00:00
|
|
|
static inline void zend_pzval_lock_func(zval *z)
|
2001-06-21 21:31:33 +00:00
|
|
|
{
|
2001-08-31 21:47:26 +00:00
|
|
|
z->refcount++;
|
2001-06-21 21:31:33 +00:00
|
|
|
}
|
|
|
|
|
2001-07-27 10:10:39 +00:00
|
|
|
#define PZVAL_UNLOCK(z) zend_pzval_unlock_func(z TSRMLS_CC)
|
2001-06-21 21:31:33 +00:00
|
|
|
|
2001-07-27 10:10:39 +00:00
|
|
|
static inline void zend_pzval_unlock_func(zval *z TSRMLS_DC)
|
2001-06-21 21:31:33 +00:00
|
|
|
{
|
2001-08-31 21:47:26 +00:00
|
|
|
z->refcount--;
|
|
|
|
if (!z->refcount) {
|
|
|
|
z->refcount = 1;
|
|
|
|
z->is_ref = 0;
|
|
|
|
EG(garbage)[EG(garbage_ptr)++] = z;
|
2001-06-21 22:30:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-07-27 10:10:39 +00:00
|
|
|
static inline void zend_clean_garbage(TSRMLS_D)
|
2001-06-21 22:30:23 +00:00
|
|
|
{
|
|
|
|
while (EG(garbage_ptr)) {
|
|
|
|
zval_ptr_dtor(&EG(garbage)[--EG(garbage_ptr)]);
|
|
|
|
}
|
2001-06-21 21:31:33 +00:00
|
|
|
}
|
2000-02-01 22:04:52 +00:00
|
|
|
|
|
|
|
#define SELECTIVE_PZVAL_LOCK(pzv, pzn) if (!((pzn)->u.EA.type & EXT_TYPE_UNUSED)) { PZVAL_LOCK(pzv); }
|
|
|
|
|
2000-07-02 23:54:19 +00:00
|
|
|
#endif /* ZEND_EXECUTE_LOCKS_H */
|
2003-02-01 01:49:15 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Local variables:
|
|
|
|
* tab-width: 4
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* indent-tabs-mode: t
|
|
|
|
* End:
|
|
|
|
*/
|