]> granicus.if.org Git - php/commitdiff
- Stop using the locking mechanism and start using refcount.
authorAndi Gutmans <andi@php.net>
Tue, 28 Sep 1999 17:37:14 +0000 (17:37 +0000)
committerAndi Gutmans <andi@php.net>
Tue, 28 Sep 1999 17:37:14 +0000 (17:37 +0000)
  Now we know when we need to free but we still need to support it

Zend/zend_compile.h
Zend/zend_execute.c
Zend/zend_execute_API.c

index 23fd4936de5286e7084fcec3101112e3576b4d69..d26adba0d61a89dc456d0175325e8d7a5b827db6 100644 (file)
@@ -553,12 +553,25 @@ int zendlex(znode *zendlval CLS_DC);
 #define ZEND_CTOR_CALL                 1<<1
 
 
+#define AI_USE_PTR(ai) \
+       if ((ai).ptr_ptr) { \
+               (ai).ptr = *((ai).ptr_ptr); \
+               (ai).ptr_ptr = &((ai).ptr); \
+       } else { \
+               (ai).ptr = NULL; \
+       }
+
 #define PZVAL_IS_REF(z)                ((z)->EA.is_ref)
 #define PZVAL_IS_LOCKED(z)     ((z)->EA.locks>0)
 
+#if 0
 #define PZVAL_LOCK(z)  (z)->EA.locks++
 #define PZVAL_UNLOCK(z)        (z)->EA.locks--
 #define SELECTIVE_PZVAL_LOCK(pzv, pzn)         if (!((pzn)->u.EA.type & EXT_TYPE_UNUSED)) { PZVAL_LOCK(pzv); }
-
+#else
+#define PZVAL_LOCK(z)  ((z)->refcount++)
+#define PZVAL_UNLOCK(z)        ((z)->refcount--)
+#define SELECTIVE_PZVAL_LOCK(pzv, pzn)         if (!((pzn)->u.EA.type & EXT_TYPE_UNUSED)) { PZVAL_LOCK(pzv); }
+#endif
 
 #endif /* _COMPILE_H */
index 11b06ae644b437c7330bcb1ad4f782a1a136cf62..542a75c1c539e16a67bf2cd52cdc407fd6b8fca9 100644 (file)
 # include <alloca.h>
 #endif
 
-#define AI_USE_PTR(ai) \
-       if ((ai).ptr_ptr) { \
-               (ai).ptr = *((ai).ptr_ptr); \
-               (ai).ptr_ptr = &((ai).ptr); \
-       } else { \
-               (ai).ptr = NULL; \
-       }
-
 #define get_zval_ptr(node, Ts, should_free, type) _get_zval_ptr(node, Ts, should_free ELS_CC)
 #define get_zval_ptr_ptr(node, Ts, type) _get_zval_ptr_ptr(node, Ts ELS_CC)
 
@@ -334,6 +326,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
                if (variable_ptr->refcount==0) {
                        switch (type) {
                                case IS_VAR:
+                                       /*
                                        if (PZVAL_IS_LOCKED(value)) {
                                                zval *orig_value = value;
 
@@ -343,6 +336,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
                                                value->EA.locks = 0;
                                                zval_copy_ctor(value);
                                        }
+                                       */
                                        /* break missing intentionally */
                                case IS_CONST:
                                        if (variable_ptr==value) {
@@ -375,6 +369,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
                } else { /* we need to split */
                        switch (type) {
                                case IS_VAR:
+                                       /*
                                        if (PZVAL_IS_LOCKED(value)) {
                                                zval *orig_value = value;
 
@@ -384,6 +379,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
                                                value->EA.locks = 0;
                                                zval_copy_ctor(value);
                                        }
+                                       */
                                        /* break missing intentionally */
                                case IS_CONST:
                                        if (PZVAL_IS_REF(value)) {
index 01d8128a9acc206c1c748d99697c4939ba5e8270..9b6f1d04db40758ee94a31a0cca34e491b4b12cc 100644 (file)
 #include "zend_extensions.h"
 
 
-#define AI_USE_PTR(ai) \
-       if ((ai).ptr_ptr) { \
-               (ai).ptr = *((ai).ptr_ptr); \
-               (ai).ptr_ptr = &((ai).ptr); \
-       } else { \
-               (ai).ptr = NULL; \
-       }
-
 ZEND_API void (*zend_execute)(zend_op_array *op_array ELS_DC);