cvs: ZendEngine2 / zend.h zend_variables.c zend_variables.h
| From: | Andi Gutmans | Date: | Sun, 26 Sep 2004 20:03:57 +0000 |
| Subject: | cvs: ZendEngine2 / zend.h zend_variables.c zend_variables.h | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-3026@lists.php.net to get a copy of this message | ||
andi Sun Sep 26 16:03:57 2004 EDT
Modified files:
/ZendEngine2 zend.h zend_variables.c zend_variables.h
Log:
- Apply Thies and Sterling's patch which doesn't call ctor/dtor functions
- for types which don't require it (BOOL/NULL/LONG/DOUBLE)
- Breaks serialization!!!
http://cvs.php.net/diff.php/ZendEngine2/zend.h?r1=1.262&r2=1.263&ty=u
Index: ZendEngine2/zend.h
diff -u ZendEngine2/zend.h:1.262 ZendEngine2/zend.h:1.263
--- ZendEngine2/zend.h:1.262 Wed Sep 22 08:49:08 2004
+++ ZendEngine2/zend.h Sun Sep 26 16:03:54 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend.h,v 1.262 2004/09/22 12:49:08 hyanantha Exp $ */
+/* $Id: zend.h,v 1.263 2004/09/26 20:03:54 andi Exp $ */
#ifndef ZEND_H
#define ZEND_H
@@ -386,13 +386,14 @@
/* data types */
+/* All data types <= IS_BOOL have their constructor/destructors skipped */
#define IS_NULL 0
#define IS_LONG 1
#define IS_DOUBLE 2
-#define IS_STRING 3
+#define IS_BOOL 3
#define IS_ARRAY 4
#define IS_OBJECT 5
-#define IS_BOOL 6
+#define IS_STRING 6
#define IS_RESOURCE 7
#define IS_CONSTANT 8
#define IS_CONSTANT_ARRAY 9
http://cvs.php.net/diff.php/ZendEngine2/zend_variables.c?r1=1.58&r2=1.59&ty=u
Index: ZendEngine2/zend_variables.c
diff -u ZendEngine2/zend_variables.c:1.58 ZendEngine2/zend_variables.c:1.59
--- ZendEngine2/zend_variables.c:1.58 Mon Jul 19 03:19:03 2004
+++ ZendEngine2/zend_variables.c Sun Sep 26 16:03:54 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_variables.c,v 1.58 2004/07/19 07:19:03 andi Exp $ */
+/* $Id: zend_variables.c,v 1.59 2004/09/26 20:03:54 andi Exp $ */
#include <stdio.h>
#include "zend.h"
@@ -27,11 +27,8 @@
#include "zend_list.h"
-ZEND_API void _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC)
+ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC)
{
- if (zvalue->type==IS_LONG) {
- return;
- }
switch (zvalue->type & ~IS_CONSTANT_INDEX) {
case IS_STRING:
case IS_CONSTANT:
@@ -104,7 +101,7 @@
}
-ZEND_API int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC)
+ZEND_API int _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
{
switch (zvalue->type) {
case IS_RESOURCE: {
http://cvs.php.net/diff.php/ZendEngine2/zend_variables.h?r1=1.29&r2=1.30&ty=u
Index: ZendEngine2/zend_variables.h
diff -u ZendEngine2/zend_variables.h:1.29 ZendEngine2/zend_variables.h:1.30
--- ZendEngine2/zend_variables.h:1.29 Fri Feb 20 03:03:27 2004
+++ ZendEngine2/zend_variables.h Sun Sep 26 16:03:54 2004
@@ -17,17 +17,36 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_variables.h,v 1.29 2004/02/20 08:03:27 hholzgra Exp $ */
+/* $Id: zend_variables.h,v 1.30 2004/09/26 20:03:54 andi Exp $ */
#ifndef ZEND_VARIABLES_H
#define ZEND_VARIABLES_H
-
BEGIN_EXTERN_C()
+
+ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC);
+
+static inline void _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC)
+{
+ if (zvalue->type <= IS_BOOL) {
+ return;
+ }
+ _zval_dtor_func(zvalue ZEND_FILE_LINE_CC);
+}
+
+ZEND_API int _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC);
+
+static inline int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC)
+{
+ if (zvalue->type <= IS_BOOL) {
+ return;
+ }
+ _zval_copy_ctor_func(zvalue ZEND_FILE_LINE_CC);
+}
+
+
ZEND_API int zend_print_variable(zval *var);
-ZEND_API int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC);
-ZEND_API void _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC);
ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC);
ZEND_API void _zval_internal_dtor(zval *zvalue ZEND_FILE_LINE_DC);
ZEND_API void _zval_internal_ptr_dtor(zval **zvalue ZEND_FILE_LINE_DC);