summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.h
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-01-31 19:18:07 +0000
committerZeev Suraski <zeev@php.net>2000-01-31 19:18:07 +0000
commitf2d3ce4170e734535185e2f1a7a1368e65622342 (patch)
tree2fc17e3cdd9b14aadd066bea00fed29d97fb0c2d /Zend/zend_compile.h
parent0517436bf94beb5c454fd8be1d73ef3efa01c0e5 (diff)
downloadphp-git-f2d3ce4170e734535185e2f1a7a1368e65622342.tar.gz
- Optimized garbage mechanism
- Fixed another buglet in the parser
Diffstat (limited to 'Zend/zend_compile.h')
-rw-r--r--Zend/zend_compile.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 5d0253560a..5e7f675297 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -582,13 +582,17 @@ int zendlex(znode *zendlval CLS_DC);
#define PZVAL_LOCK(z) ((z)->refcount++)
#define PZVAL_UNLOCK(z) { ((z)->refcount--); \
- if (!(z)->refcount && !EG(suspend_garbage)) { \
+ if (!(z)->refcount) { \
+ (z)->refcount = 1; \
+ (z)->is_ref = 0; \
EG(garbage)[EG(garbage_ptr)++] = (z); \
if (EG(garbage_ptr) == 4) { \
- zval_dtor(EG(garbage)[0]); \
- FREE_ZVAL(EG(garbage)[0]); \
- zval_dtor(EG(garbage)[1]); \
- FREE_ZVAL(EG(garbage)[1]); \
+ if (EG(garbage)[0]->refcount==1) { \
+ zval_ptr_dtor(&EG(garbage)[0]); \
+ } \
+ if (EG(garbage)[1]->refcount==1) { \
+ zval_ptr_dtor(&EG(garbage)[1]); \
+ } \
EG(garbage)[0] = EG(garbage)[2]; \
EG(garbage)[1] = EG(garbage)[3]; \
EG(garbage_ptr) -= 2; \
@@ -596,9 +600,6 @@ int zendlex(znode *zendlval CLS_DC);
} \
}
-#define SUSPEND_GARBAGE() (EG(suspend_garbage)=1)
-#define RESUME_GARBAGE() (EG(suspend_garbage)=0)
-
#define SELECTIVE_PZVAL_LOCK(pzv, pzn) if (!((pzn)->u.EA.type & EXT_TYPE_UNUSED)) { PZVAL_LOCK(pzv); }