summaryrefslogtreecommitdiff
path: root/Zend/zend.h
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend.h')
-rw-r--r--Zend/zend.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/Zend/zend.h b/Zend/zend.h
index 8533a2d5c1..0f41887a58 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -276,6 +276,10 @@ END_EXTERN_C()
#define INIT_ZVAL(z) z = zval_used_for_init;
+#define ALLOC_INIT_ZVAL(zp) \
+ (zp) = (zval *) emalloc(sizeof(zval)); \
+ INIT_ZVAL(*zp);
+
#define MAKE_STD_ZVAL(zv) \
zv = (zval *) emalloc(sizeof(zval)); \
INIT_PZVAL(zv);
@@ -290,10 +294,18 @@ END_EXTERN_C()
**(ppzv) = *orig_ptr; \
zval_copy_ctor(*(ppzv)); \
(*(ppzv))->refcount=1; \
- (*(ppzv))->is_ref = 0; \
+ (*(ppzv))->is_ref = 0; \
} \
}
+#define COPY_PZVAL_TO_ZVAL(zv, pzv) \
+ (zv) = *(pzv); \
+ if ((pzv)->refcount>1) { \
+ zval_copy_ctor(&(zv)); \
+ (pzv)->refcount--; \
+ } \
+ INIT_PZVAL(&(zv));
+
#define ZEND_MAX_RESERVED_RESOURCES 1
#endif /* _ZEND_H */