cvs: pecl /apc apc_compile.c apc_globals.h apc_zend.c apc_zend.h php_apc.c

From: Date: Wed, 18 Feb 2009 08:59:00 +0000
Subject: cvs: pecl /apc apc_compile.c apc_globals.h apc_zend.c apc_zend.h php_apc.c
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-11976@lists.php.net to get a copy of this message
gopalv Wed Feb 18 08:59:00 2009 UTC Modified files: /pecl/apc php_apc.c apc_globals.h apc_compile.c apc_zend.c apc_zend.h Log: Bug #15984: make reserved_offset a true global (patch attached with bug) http://cvs.php.net/viewvc.cgi/pecl/apc/php_apc.c?r1=3.208&r2=3.209&diff_format=u Index: pecl/apc/php_apc.c diff -u pecl/apc/php_apc.c:3.208 pecl/apc/php_apc.c:3.209 --- pecl/apc/php_apc.c:3.208 Mon Feb 16 18:45:40 2009 +++ pecl/apc/php_apc.c Wed Feb 18 08:59:00 2009 @@ -26,7 +26,7 @@ */ -/* $Id: php_apc.c,v 3.208 2009/02/16 18:45:40 shire Exp $ */ +/* $Id: php_apc.c,v 3.209 2009/02/18 08:59:00 gopalv Exp $ */ #include "apc_zend.h" #include "apc_cache.h" @@ -98,7 +98,6 @@ memset(&(apc_globals->rfc1867_data), 0, sizeof(apc_rfc1867_data)); #endif apc_globals->copied_zvals = NULL; - apc_globals->reserved_offset = -1; apc_globals->force_file_update = 0; apc_globals->coredump_unmap = 0; apc_globals->preload_path = NULL; @@ -224,7 +223,7 @@ php_info_print_table_row(2, "MMAP Support", "Disabled"); #endif php_info_print_table_row(2, "Locking type", APC_LOCK_TYPE); - php_info_print_table_row(2, "Revision", "$Revision: 3.208 $"); + php_info_print_table_row(2, "Revision", "$Revision: 3.209 $"); php_info_print_table_row(2, "Build Date", __DATE__ " " __TIME__); php_info_print_table_end(); DISPLAY_INI_ENTRIES(); http://cvs.php.net/viewvc.cgi/pecl/apc/apc_globals.h?r1=3.91&r2=3.92&diff_format=u Index: pecl/apc/apc_globals.h diff -u pecl/apc/apc_globals.h:3.91 pecl/apc/apc_globals.h:3.92 --- pecl/apc/apc_globals.h:3.91 Mon Jan 26 06:57:51 2009 +++ pecl/apc/apc_globals.h Wed Feb 18 08:59:00 2009 @@ -29,7 +29,7 @@ */ -/* $Id: apc_globals.h,v 3.91 2009/01/26 06:57:51 shire Exp $ */ +/* $Id: apc_globals.h,v 3.92 2009/02/18 08:59:00 gopalv Exp $ */ #ifndef APC_GLOBALS_H #define APC_GLOBALS_H @@ -97,7 +97,6 @@ apc_rfc1867_data rfc1867_data;/* Per-request data */ #endif HashTable *copied_zvals; /* my_copy recursion detection list */ - int reserved_offset; /* offset for apc info in op_array->reserved[] */ zend_bool force_file_update; /* force files to be updated during apc_compile_file */ char canon_path[MAXPATHLEN]; /* canonical path for key data */ #if APC_FILEHITS http://cvs.php.net/viewvc.cgi/pecl/apc/apc_compile.c?r1=3.119&r2=3.120&diff_format=u Index: pecl/apc/apc_compile.c diff -u pecl/apc/apc_compile.c:3.119 pecl/apc/apc_compile.c:3.120 --- pecl/apc/apc_compile.c:3.119 Wed Feb 11 15:06:40 2009 +++ pecl/apc/apc_compile.c Wed Feb 18 08:59:00 2009 @@ -28,7 +28,7 @@ */ -/* $Id: apc_compile.c,v 3.119 2009/02/11 15:06:40 pajoye Exp $ */ +/* $Id: apc_compile.c,v 3.120 2009/02/18 08:59:00 gopalv Exp $ */ #include "apc_compile.h" #include "apc_globals.h" @@ -930,10 +930,10 @@ /* deep-copy the opcodes */ CHECK(dst->opcodes = (zend_op*) apc_pool_alloc(pool, sizeof(zend_op) * src->last)); - if(APCG(reserved_offset) != -1) { + if(apc_reserved_offset != -1) { /* Insanity alert: the void* pointer is cast into an apc_opflags_t * struct. apc_zend_init() checks to ensure that it fits in a void* */ - flags = (apc_opflags_t*) & (dst->reserved[APCG(reserved_offset)]); + flags = (apc_opflags_t*) & (dst->reserved[apc_reserved_offset]); memset(flags, 0, sizeof(apc_opflags_t)); /* assert(sizeof(apc_opflags_t) < sizeof(dst->reserved)); */ } @@ -1226,8 +1226,8 @@ int i=src->last; zend_op *zo; zend_op *dzo; - apc_opflags_t * flags = APCG(reserved_offset) != -1 ? - (apc_opflags_t*) & (src->reserved[APCG(reserved_offset)]) : NULL; + apc_opflags_t * flags = apc_reserved_offset != -1 ? + (apc_opflags_t*) & (src->reserved[apc_reserved_offset]) : NULL; int needcopy = flags ? flags->deep_copy : 1; /* auto_globals_jit was not in php4 */ int do_prepare_fetch_global = PG(auto_globals_jit) && (flags == NULL || flags->unknown_global); http://cvs.php.net/viewvc.cgi/pecl/apc/apc_zend.c?r1=3.21&r2=3.22&diff_format=u Index: pecl/apc/apc_zend.c diff -u pecl/apc/apc_zend.c:3.21 pecl/apc/apc_zend.c:3.22 --- pecl/apc/apc_zend.c:3.21 Mon Jan 26 06:57:51 2009 +++ pecl/apc/apc_zend.c Wed Feb 18 08:59:00 2009 @@ -25,11 +25,14 @@ */ -/* $Id: apc_zend.c,v 3.21 2009/01/26 06:57:51 shire Exp $ */ +/* $Id: apc_zend.c,v 3.22 2009/02/18 08:59:00 gopalv Exp $ */ #include "apc_zend.h" #include "apc_globals.h" +/* true global */ +int apc_reserved_offset; + void* apc_php_malloc(size_t n) { return emalloc(n); @@ -135,9 +138,9 @@ zval_dtor(&tmp_inc_filename); } - if(APCG(reserved_offset) != -1) { + if(apc_reserved_offset != -1) { /* Insanity alert: look into apc_compile.c for why a void** is cast to a apc_opflags_t* */ - flags = (apc_opflags_t*) & (execute_data->op_array->reserved[APCG(reserved_offset)]); + flags = (apc_opflags_t*) & (execute_data->op_array->reserved[apc_reserved_offset]); } if(flags && flags->deep_copy == 1) { @@ -157,9 +160,9 @@ void apc_zend_init(TSRMLS_D) { zend_extension dummy_ext; - APCG(reserved_offset) = zend_get_resource_handle(&dummy_ext); - assert(APCG(reserved_offset) == dummy_ext.resource_number); - assert(APCG(reserved_offset) != -1); + apc_reserved_offset = zend_get_resource_handle(&dummy_ext); + assert(apc_reserved_offset == dummy_ext.resource_number); + assert(apc_reserved_offset != -1); assert(sizeof(apc_opflags_t) <= sizeof(void*)); if (!APCG(include_once)) { /* If we're not overriding the INCLUDE_OR_EVAL handler, then just skip this malarkey */ http://cvs.php.net/viewvc.cgi/pecl/apc/apc_zend.h?r1=3.12&r2=3.13&diff_format=u Index: pecl/apc/apc_zend.h diff -u pecl/apc/apc_zend.h:3.12 pecl/apc/apc_zend.h:3.13 --- pecl/apc/apc_zend.h:3.12 Mon Jan 26 06:57:51 2009 +++ pecl/apc/apc_zend.h Wed Feb 18 08:59:00 2009 @@ -25,7 +25,7 @@ */ -/* $Id: apc_zend.h,v 3.12 2009/01/26 06:57:51 shire Exp $ */ +/* $Id: apc_zend.h,v 3.13 2009/02/18 08:59:00 gopalv Exp $ */ #ifndef APC_ZEND_H #define APC_ZEND_H @@ -83,6 +83,9 @@ extern void apc_zend_shutdown(TSRMLS_D); +/* offset for apc info in op_array->reserved */ +extern int apc_reserved_offset; + #ifndef ZEND_VM_KIND_CALL /* Not currently defined by any ZE version */ # define ZEND_VM_KIND_CALL 1 #endif

« previous php.pecl.cvs (#11976) next »