Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12998 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63818 invoked by uid 1010); 26 Sep 2004 20:07:21 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 61621 invoked from network); 26 Sep 2004 20:07:02 -0000 Received: from unknown (HELO mail.zend.com) (80.74.107.235) by pb1.pair.com with SMTP; 26 Sep 2004 20:07:02 -0000 Received: (qmail 32594 invoked from network); 26 Sep 2004 20:07:01 -0000 Received: from localhost (HELO AndiNotebook.zend.com) (127.0.0.1) by localhost with SMTP; 26 Sep 2004 20:07:01 -0000 Message-ID: <5.1.0.14.2.20040926130504.0493c080@localhost> X-Sender: andi@localhost X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Sun, 26 Sep 2004 13:06:48 -0700 To: internals@lists.php.net Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Fwd: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend.h zend_variables.c zend_variables.h From: andi@zend.com (Andi Gutmans) Is there something we can do about serialization breaking between 5.0.xand 5.1.x? IIRC we don't save the PHP version number with serialized data. If so, we could adjust the types according to version check. Comments/ideas? Andi From: "Andi Gutmans" To: zend-engine-cvs@lists.php.net Date: Sun, 26 Sep 2004 20:03:57 -0000 Subject: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend.h zend_variables.c zend_variables.h 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 #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); -- Zend Engine CVS Mailing List (http://cvs.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php