mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
- Stop using the locking mechanism and start using refcount.
Now we know when we need to free but we still need to support it
This commit is contained in:
parent
cf6c92949c
commit
59d5462a6a
3 changed files with 18 additions and 17 deletions
|
@ -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 */
|
||||
|
|
|
@ -35,14 +35,6 @@
|
|||
# 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)) {
|
||||
|
|
|
@ -32,14 +32,6 @@
|
|||
#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);
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue