Yasuo Ohgaki
yohga****@users*****
2002年 7月 9日 (火) 18:02:01 JST
yohgaki 02/07/09 18:02:01 Modified: . Tag: ORIG ChangeLog Zend.m4 acconfig.h zend.c zend.h zend_API.h zend_alloc.c zend_alloc.h zend_builtin_functions.c zend_compile.h zend_constants.c zend_constants.h zend_execute.h zend_globals.h zend_ini_scanner.l zend_language_parser.y zend_list.h zend_llist.c zend_modules.h zend_operators.c zend_variables.c zend_variables.h Log: Recent cvs.php.net changes Revision Changes Path No revision No revision 1.2.2.5 +127 -1 Zend/ChangeLog Index: ChangeLog =================================================================== RCS file: /cvsroot/php-i18n/Zend/ChangeLog,v retrieving revision 1.2.2.4 retrieving revision 1.2.2.5 diff -u -r1.2.2.4 -r1.2.2.5 --- ChangeLog 19 May 2002 11:10:23 -0000 1.2.2.4 +++ ChangeLog 9 Jul 2002 09:02:00 -0000 1.2.2.5 @@ -1,3 +1,129 @@ +2002-06-29 Andi Gutmans <andi****@zend*****> + + * zend_language_parser.y: - Add missing semi-colon. + + * zend_compile.c: - Revert previous patch. + + * zend_compile.c: - Fix for bug 17882 + + * zend_operators.c: - Fix bug 15037 + +2002-06-28 Jani Taskinen <snipe****@iki*****> + + * zend_modules.h: + Updated the API number (to be at least same as it is in PHP_4_2_0 branch) + +2002-06-26 Andi Gutmans <andi****@zend*****> + + * zend_alloc.c: + - Put back the optimization which releases heaps in non-debug mode before + - trying to detect leaks + +2002-06-24 Andi Gutmans <andi****@zend*****> + + * zend_alloc.c: + - MFZE2 (Fixes some warnings and a bug introduced in an earlier patch) + + * zend_alloc.c: - Clean up shutdown_memory_manager(). + +2002-06-24 Sebastian Bergmann <sb****@sebas*****> + + * Zend.m4: IMHO, ZTS should no longer be labeled experimental. + +2002-06-24 Andi Gutmans <andi****@zend*****> + + * zend_alloc.c: - Only do some initializations when needed + - Nuke some old commented code + + * zend.h + zend_types.h: + - Move type definitions out of zend.h so that we can include them without + - having to include all of zend.h (which sometimes causes circular + - dependencies) + +2002-06-22 Andi Gutmans <andi****@zend*****> + + * zend_language_parser.y: - MFH + + * zend_language_parser.y: + - This typo has survived for a loooooooooong time. + + * zend_alloc.c + zend_alloc.h + zend_globals.h: - Completely nuke the persist_alloc() stuff + + * zend_alloc.c + zend_alloc.h + zend_constants.c + zend_constants.h + zend_variables.c + zend_variables.h: - Nuke persist_alloc() + +2002-06-19 Andi Gutmans <andi****@zend*****> + + * zend_constants.c: + - Fix problem where you couldn't define constants with different cases but + - the same name. + +2002-06-18 Derick Rethans <d.ret****@jdime*****> + + * zend.c: + - Change the order of which modules are unloaded to the reverse order of + which they were loaded. + - Change the order of which modules are unloaded to the reverse order of + which they were loaded. (Derick, Zend Engine) + +2002-06-12 Andrei Zmievski <andre****@php*****> + + * zend_builtin_functions.c: + set_error_handler() should take methods as callbacks. Also fixed it to report + invalid callbacks. + +2002-06-08 Andrei Zmievski <andre****@php*****> + + * zend_builtin_functions.c: + Extension registered classes preserve their case in the class entries, + so we need to use case-insensitive comparison. A bit slower, but more + right. + +2002-06-05 Derick Rethans <d.ret****@jdime*****> + + * zend_llist.c: - MFH + + * zend_globals.h + zend_llist.c: - MFZE2 (memleak fix by Stefan Sesser) + +2002-06-04 Derick Rethans <d.ret****@jdime*****> + + * zend_ini_scanner.l: - oops + + * zend_ini_scanner.l: - MFZE2 + +2002-05-29 Venkat Raghavan S <rvenk****@novel*****> + + * acconfig.h: Changes to build Zend on NetWare + +2002-05-28 Venkat Raghavan S <rvenk****@novel*****> + + * zend.h: Basic NetWare changes + +2002-05-20 Zeev Suraski <zeev****@zend*****> + + * zend_execute.h + zend_list.h + zend_API.h: Expose more C++ API's (Wez) + +2002-05-20 Masaki Fujimoto <fujim****@studi*****> + + * zend_compile.h: removed unused prototype. + +2002-05-19 Masaki Fujimoto <fujim****@studi*****> + + * zend_compile.c + zend_language_parser.y + zend_language_scanner.l: + replaced encoding directive by declare directive. + 2002-05-18 Masaki Fujimoto <fujim****@studi*****> * zend_compile.c @@ -14,7 +140,7 @@ 2002-05-13 Sterling Hughes <sterl****@bumbl*****> - * zend_qsort.c: add $Id: ChangeLog,v 1.33 2002/05/19 00:22:20 changelog Exp $ tag + * zend_qsort.c: add $Id: ChangeLog,v 1.48 2002/06/30 00:22:28 changelog Exp $ tag 2002-05-13 Derick Rethans <d.ret****@jdime*****> 1.2.2.2 +2 -2 Zend/Zend.m4 Index: Zend.m4 =================================================================== RCS file: /cvsroot/php-i18n/Zend/Zend.m4,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -u -r1.2.2.1 -r1.2.2.2 --- Zend.m4 9 May 2002 04:02:45 -0000 1.2.2.1 +++ Zend.m4 9 Jul 2002 09:02:00 -0000 1.2.2.2 @@ -1,5 +1,5 @@ dnl -dnl $Id: Zend.m4,v 1.33 2002/05/08 12:29:51 hirokawa Exp $ +dnl $Id: Zend.m4,v 1.34 2002/06/24 16:10:33 sebastian Exp $ dnl dnl This file contains Zend specific autoconf functions. dnl @@ -147,7 +147,7 @@ ZEND_MULTIBYTE=no ]) -AC_MSG_CHECKING(whether to enable experimental ZTS) +AC_MSG_CHECKING(whether to enable thread-safety) AC_MSG_RESULT($ZEND_EXPERIMENTAL_ZTS) AC_MSG_CHECKING(whether to enable inline optimization for GCC) 1.2.2.1 +4 -0 Zend/acconfig.h Index: acconfig.h =================================================================== RCS file: /cvsroot/php-i18n/Zend/acconfig.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -r1.2 -r1.2.2.1 --- acconfig.h 29 Apr 2002 02:25:13 -0000 1.2 +++ acconfig.h 9 Jul 2002 09:02:00 -0000 1.2.2.1 @@ -1,7 +1,9 @@ #define ZEND_API #define ZEND_DLEXPORT +#ifndef NETWARE @TOP@ +#endif #undef uint #undef ulong @@ -9,7 +11,9 @@ /* Define if you want to enable memory limit support */ #define MEMORY_LIMIT 0 +#ifndef NETWARE @BOTTOM@ +#endif #ifdef HAVE_STDLIB_H # include <stdlib.h> 1.2.2.1 +1 -1 Zend/zend.c Index: zend.c =================================================================== RCS file: /cvsroot/php-i18n/Zend/zend.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -r1.2 -r1.2.2.1 --- zend.c 29 Apr 2002 02:25:13 -0000 1.2 +++ zend.c 9 Jul 2002 09:02:00 -0000 1.2.2.1 @@ -487,7 +487,7 @@ zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC); #endif zend_destroy_rsrc_list_dtors(); - zend_hash_destroy(&module_registry); + zend_hash_graceful_reverse_destroy(&module_registry); zend_hash_destroy(GLOBAL_FUNCTION_TABLE); free(GLOBAL_FUNCTION_TABLE); zend_hash_destroy(GLOBAL_CLASS_TABLE); 1.2.2.1 +7 -7 Zend/zend.h Index: zend.h =================================================================== RCS file: /cvsroot/php-i18n/Zend/zend.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -r1.2 -r1.2.2.1 --- zend.h 29 Apr 2002 02:25:13 -0000 1.2 +++ zend.h 9 Jul 2002 09:02:00 -0000 1.2.2.1 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend.h,v 1.153 2002/04/04 00:24:33 sniper Exp $ */ +/* $Id: zend.h,v 1.155 2002/06/24 07:10:19 andi Exp $ */ #ifndef ZEND_H #define ZEND_H @@ -41,6 +41,10 @@ #ifdef ZEND_WIN32 # include "zend_config.w32.h" # define ZEND_PATHS_SEPARATOR ';' +#elif defined(NETWARE) +# include "zend_config.nw.h" +# include "acconfig.h" +# define ZEND_PATHS_SEPARATOR ';' #elif defined(__riscos__) # include "zend_config.h" # define ZEND_PATHS_SEPARATOR ';' @@ -128,7 +132,7 @@ # endif #endif -#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(ZEND_WIN32)) +#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(ZEND_WIN32)) && !(defined(ZTS) && defined(NETWARE)) # define do_alloca(p) alloca(p) # define free_alloca(p) #else @@ -173,11 +177,7 @@ #include "zend_errors.h" #include "zend_alloc.h" -typedef unsigned char zend_bool; -typedef unsigned char zend_uchar; -typedef unsigned int zend_uint; -typedef unsigned long zend_ulong; -typedef unsigned short zend_ushort; +#include "zend_types.h" #ifdef HAVE_LIMITS_H # include <limits.h> 1.2.2.1 +4 -0 Zend/zend_API.h Index: zend_API.h =================================================================== RCS file: /cvsroot/php-i18n/Zend/zend_API.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -r1.2 -r1.2.2.1 --- zend_API.h 29 Apr 2002 02:25:13 -0000 1.2 +++ zend_API.h 9 Jul 2002 09:02:00 -0000 1.2.2.1 @@ -29,6 +29,8 @@ #include "zend_variables.h" #include "zend_execute.h" + +BEGIN_EXTERN_C() #define ZEND_FN(name) zif_##name #define ZEND_NAMED_FUNCTION(name) void name(INTERNAL_FUNCTION_PARAMETERS) #define ZEND_FUNCTION(name) ZEND_NAMED_FUNCTION(ZEND_FN(name)) @@ -416,6 +418,8 @@ #define ZEND_RSHUTDOWN_FUNCTION ZEND_MODULE_DEACTIVATE_D #define ZEND_MINFO_FUNCTION ZEND_MODULE_INFO_D +END_EXTERN_C() + #endif /* ZEND_API_H */ 1.2.2.2 +23 -73 Zend/zend_alloc.c Index: zend_alloc.c =================================================================== RCS file: /cvsroot/php-i18n/Zend/zend_alloc.c,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -u -r1.2.2.1 -r1.2.2.2 --- zend_alloc.c 30 Apr 2002 07:51:04 -0000 1.2.2.1 +++ zend_alloc.c 9 Jul 2002 09:02:00 -0000 1.2.2.2 @@ -88,10 +88,8 @@ #define REMOVE_POINTER_FROM_LIST(p) \ - if (!p->persistent && p==AG(head)) { \ + if (p==AG(head)) { \ AG(head) = p->pNext; \ - } else if (p->persistent && p==AG(phead)) { \ - AG(phead) = p->pNext; \ } else { \ p->pLast->pNext = p->pNext; \ } \ @@ -100,19 +98,11 @@ } #define ADD_POINTER_TO_LIST(p) \ - if (p->persistent) { \ - p->pNext = AG(phead); \ - if (AG(phead)) { \ - AG(phead)->pLast = p; \ - } \ - AG(phead) = p; \ - } else { \ - p->pNext = AG(head); \ - if (AG(head)) { \ - AG(head)->pLast = p; \ - } \ - AG(head) = p; \ + p->pNext = AG(head); \ + if (AG(head)) { \ + AG(head)->pLast = p; \ } \ + AG(head) = p; \ p->pLast = (zend_mem_header *) NULL; #define DECLARE_CACHE_VARS() \ @@ -152,7 +142,6 @@ AG(cache_stats)[CACHE_INDEX][1]++; memcpy((((char *) p) + sizeof(zend_mem_header) + MEM_HEADER_PADDING + size), &mem_block_end_magic, sizeof(long)); #endif - p->persistent = 0; p->cached = 0; p->size = size; return (void *)((char *)p + sizeof(zend_mem_header) + MEM_HEADER_PADDING); @@ -177,7 +166,7 @@ HANDLE_UNBLOCK_INTERRUPTIONS(); return (void *)p; } - p->persistent = p->cached = 0; + p->cached = 0; ADD_POINTER_TO_LIST(p); p->size = size; /* Save real size for correct cache output */ #if ZEND_DEBUG @@ -228,7 +217,7 @@ #endif if (!ZEND_DISABLE_MEMORY_CACHE - && !p->persistent && (CACHE_INDEX < MAX_CACHED_MEMORY) && (AG(cache_count)[CACHE_INDEX] < MAX_CACHED_ENTRIES)) { + && (CACHE_INDEX < MAX_CACHED_MEMORY) && (AG(cache_count)[CACHE_INDEX] < MAX_CACHED_ENTRIES)) { AG(cache)[CACHE_INDEX][AG(cache_count)[CACHE_INDEX]++] = p; p->cached = 1; #if ZEND_DEBUG @@ -380,14 +369,7 @@ ZEND_API void start_memory_manager(TSRMLS_D) { -#if 0 -#ifndef ZTS - int i, j; - void *cached_entries[MAX_CACHED_MEMORY][MAX_CACHED_ENTRIES]; -#endif -#endif - - AG(phead) = AG(head) = NULL; + AG(head) = NULL; #if MEMORY_LIMIT AG(memory_limit) = 1<<30; /* ridiculous limit, effectively no limit */ @@ -395,33 +377,17 @@ AG(memory_exhausted) = 0; AG(allocated_memory_peak) = 0; #endif - +#if ZEND_ENABLE_FAST_CACHE memset(AG(fast_cache_list_head), 0, sizeof(AG(fast_cache_list_head))); +#endif +#if !ZEND_DISABLE_MEMORY_CACHE memset(AG(cache_count), 0, sizeof(AG(cache_count))); +#endif #ifdef ZEND_WIN32 AG(memory_heap) = HeapCreate(HEAP_NO_SERIALIZE, 256*1024, 0); #endif -#if 0 -#ifndef ZTS - /* Initialize cache, to prevent fragmentation */ - /* We can't do this in ZTS mode, because calling emalloc() from within start_memory_manager() - * will yield an endless recursion calling to alloc_globals_ctor() - */ - for (i=1; i<MAX_CACHED_MEMORY; i++) { - for (j=0; j<PRE_INIT_CACHE_ENTRIES; j++) { - cached_entries[i][j] = emalloc(8*i); - } - } - for (i=1; i<MAX_CACHED_MEMORY; i++) { - for (j=0; j<PRE_INIT_CACHE_ENTRIES; j++) { - efree(cached_entries[i][j]); - } - } -#endif -#endif - #if ZEND_DEBUG memset(AG(cache_stats), 0, sizeof(AG(cache_stats))); memset(AG(fast_cache_stats), 0, sizeof(AG(fast_cache_stats))); @@ -432,11 +398,10 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache TSRMLS_DC) { zend_mem_header *p, *t; - unsigned int fci, i, j; + #if ZEND_DEBUG int had_leaks = 0; #endif - zend_fast_cache_list_entry *fast_cache_list_entry, *next_fast_cache_list_entry; #if defined(ZEND_WIN32) && !ZEND_DEBUG if (clean_cache && AG(memory_heap)) { @@ -445,6 +410,10 @@ } #endif +#if ZEND_ENABLE_FAST_CACHE + zend_fast_cache_list_entry *fast_cache_list_entry, *next_fast_cache_list_entry; + unsigned int fci; + for (fci=0; fci<MAX_FAST_CACHE_TYPES; fci++) { fast_cache_list_entry = AG(fast_cache_list_head)[fci]; while (fast_cache_list_entry) { @@ -454,8 +423,11 @@ } AG(fast_cache_list_head)[fci] = NULL; } +#endif /* ZEND_ENABLE_FAST_CACHE */ +#if !ZEND_DISABLE_MEMORY_CACHE if (1 || clean_cache) { + unsigned int i, j; zend_mem_header *ptr; for (i=1; i<MAX_CACHED_MEMORY; i++) { @@ -470,6 +442,7 @@ AG(cache_count)[i] = 0; } } +#endif /* !ZEND_DISABLE_MEMORY_CACHE */ p = AG(head); t = AG(head); @@ -554,14 +527,14 @@ } } while (0); +#endif #if defined(ZEND_WIN32) && ZEND_DEBUG if (clean_cache && AG(memory_heap)) { HeapDestroy(AG(memory_heap)); + return; } #endif - -#endif } @@ -718,29 +691,6 @@ zend_debug_alloc_output("------------------------------------------------\n"); } #endif - - -ZEND_API int _persist_alloc(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) -{ - zend_mem_header *p = (zend_mem_header *) ((char *)ptr-sizeof(zend_mem_header)-MEM_HEADER_PADDING); - TSRMLS_FETCH(); - -#if ZEND_DEBUG - _mem_block_check(ptr, 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); -#endif - - HANDLE_BLOCK_INTERRUPTIONS(); - - /* remove the block from the non persistent list */ - REMOVE_POINTER_FROM_LIST(p); - - p->persistent = 1; - - /* add the block to the persistent list */ - ADD_POINTER_TO_LIST(p); - HANDLE_UNBLOCK_INTERRUPTIONS(); - return REAL_SIZE(p->size)+sizeof(zend_mem_header)+MEM_HEADER_PADDING; -} /* 1.2.2.2 +1 -5 Zend/zend_alloc.h Index: zend_alloc.h =================================================================== RCS file: /cvsroot/php-i18n/Zend/zend_alloc.h,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -u -r1.2.2.1 -r1.2.2.2 --- zend_alloc.h 30 Apr 2002 07:51:04 -0000 1.2.2.1 +++ zend_alloc.h 9 Jul 2002 09:02:00 -0000 1.2.2.2 @@ -45,8 +45,7 @@ #endif struct _zend_mem_header *pNext; struct _zend_mem_header *pLast; - unsigned int size:30; - unsigned int persistent:1; + unsigned int size:31; unsigned int cached:1; } zend_mem_header; @@ -78,7 +77,6 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); -ZEND_API int _persist_alloc(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC); /* Standard wrapper macros */ #define emalloc(size) _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) @@ -88,7 +86,6 @@ #define erealloc_recoverable(ptr, size) _erealloc((ptr), (size), 1 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) #define estrdup(s) _estrdup((s) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) #define estrndup(s, length) _estrndup((s), (length) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) -#define persist_alloc(p) _persist_alloc((p) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) /* Relay wrapper macros */ #define emalloc_rel(size) _emalloc((size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) @@ -98,7 +95,6 @@ #define erealloc_recoverable_rel(ptr, size) _erealloc((ptr), (size), 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) #define estrdup_rel(s) _estrdup((s) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) #define estrndup_rel(s, length) _estrndup((s), (length) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) -#define persist_alloc_rel(p) _persist_alloc((p) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC) /* Selective persistent/non persistent allocation macros */ #define pemalloc(size, persistent) ((persistent)?malloc(size):emalloc(size)) 1.2.2.3 +10 -2 Zend/zend_builtin_functions.c Index: zend_builtin_functions.c =================================================================== RCS file: /cvsroot/php-i18n/Zend/zend_builtin_functions.c,v retrieving revision 1.2.2.2 retrieving revision 1.2.2.3 diff -u -r1.2.2.2 -r1.2.2.3 --- zend_builtin_functions.c 19 May 2002 11:10:23 -0000 1.2.2.2 +++ zend_builtin_functions.c 9 Jul 2002 09:02:00 -0000 1.2.2.3 @@ -561,7 +561,7 @@ else ce = Z_OBJCE_PP(obj); for (; ce != NULL; ce = ce->parent) { - if ((ce->name_length == (uint)Z_STRLEN_PP(class_name)) && !memcmp(ce->name, lcname, ce->name_length)) { + if ((ce->name_length == (uint)Z_STRLEN_PP(class_name)) && !zend_binary_strcasecmp(ce->name, ce->name_length, lcname, Z_STRLEN_PP(class_name))) { efree(lcname); RETURN_TRUE; } @@ -851,13 +851,21 @@ ZEND_FUNCTION(set_error_handler) { zval **error_handler; + char *error_handler_name; zend_bool had_orig_error_handler=0; if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &error_handler)==FAILURE) { ZEND_WRONG_PARAM_COUNT(); } - convert_to_string_ex(error_handler); + if (!zend_is_callable(*error_handler, 0, &error_handler_name)) { + zend_error(E_WARNING, "%s() expects argument 1, '%s', to be a valid callback", + get_active_function_name(TSRMLS_C), error_handler_name); + efree(error_handler_name); + return; + } + efree(error_handler_name); + if (EG(user_error_handler)) { had_orig_error_handler = 1; *return_value = *EG(user_error_handler); 1.2.2.2 +0 -2 Zend/zend_compile.h Index: zend_compile.h =================================================================== RCS file: /cvsroot/php-i18n/Zend/zend_compile.h,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -u -r1.2.2.1 -r1.2.2.2 --- zend_compile.h 9 May 2002 04:02:45 -0000 1.2.2.1 +++ zend_compile.h 9 Jul 2002 09:02:00 -0000 1.2.2.2 @@ -350,8 +350,6 @@ void zend_do_ticks(TSRMLS_D); -void zend_do_encoding(znode *result, znode *arg TSRMLS_DC); - ZEND_API void function_add_ref(zend_function *function); #define INITIAL_OP_ARRAY_SIZE 64 1.2.2.1 +28 -25 Zend/zend_constants.c Index: zend_constants.c =================================================================== RCS file: /cvsroot/php-i18n/Zend/zend_constants.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -r1.2 -r1.2.2.1 --- zend_constants.c 29 Apr 2002 02:25:13 -0000 1.2 +++ zend_constants.c 9 Jul 2002 09:02:00 -0000 1.2.2.1 @@ -27,8 +27,7 @@ void free_zend_constant(zend_constant *c) { - if (!(c->flags & CONST_PERSISTENT) - || (c->flags & CONST_EFREE_PERSISTENT)) { + if (!(c->flags & CONST_PERSISTENT)) { zval_dtor(&c->value); } free(c->name); @@ -40,9 +39,6 @@ c->name = zend_strndup(c->name, c->name_len); if (!(c->flags & CONST_PERSISTENT)) { zval_copy_ctor(&c->value); - if (c->flags & CONST_EFREE_PERSISTENT) { /* persist_alloc()'d data */ - persist_alloc(&c->value); - } } } @@ -221,26 +217,27 @@ { zend_constant *c; char *lookup_name; - int retval; - - lookup_name = do_alloca(name_len+1); - memcpy(lookup_name, name, name_len+1); + int retval = 1; - zend_str_tolower(lookup_name, name_len); - - if (zend_hash_find(EG(zend_constants), lookup_name, name_len+1, (void **) &c)==SUCCESS) { - if ((c->flags & CONST_CS) && memcmp(c->name, name, name_len)!=0) { - retval=0; + if (zend_hash_find(EG(zend_constants), name, name_len+1, (void **) &c) == FAILURE) { + lookup_name = do_alloca(name_len+1); + memcpy(lookup_name, name, name_len+1); + zend_str_tolower(lookup_name, name_len); + + if (zend_hash_find(EG(zend_constants), lookup_name, name_len+1, (void **) &c)==SUCCESS) { + if ((c->flags & CONST_CS) && memcmp(c->name, name, name_len)!=0) { + retval=0; + } } else { - retval=1; - *result = c->value; - zval_copy_ctor(result); + retval=0; } - } else { - retval=0; + free_alloca(lookup_name); } - free_alloca(lookup_name); + if (retval) { + *result = c->value; + zval_copy_ctor(result); + } return retval; } @@ -248,24 +245,30 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC) { - char *lowercase_name = zend_strndup(c->name, c->name_len); + char *lowercase_name; int ret = SUCCESS; #if 0 printf("Registering constant for module %d\n", c->module_number); #endif - zend_str_tolower(lowercase_name, c->name_len); + lowercase_name = do_alloca(c->name_len); + + memcpy(lowercase_name, c->name, c->name_len); + + if (!(c->flags & CONST_CS)) { + zend_str_tolower(lowercase_name, c->name_len); + } + if (zend_hash_add(EG(zend_constants), lowercase_name, c->name_len, (void *) c, sizeof(zend_constant), NULL)==FAILURE) { free(c->name); - if (!(c->flags & CONST_PERSISTENT) - || (c->flags & CONST_EFREE_PERSISTENT)) { + if (!(c->flags & CONST_PERSISTENT)) { zval_dtor(&c->value); } zend_error(E_NOTICE,"Constant %s already defined", lowercase_name); ret = FAILURE; } - free(lowercase_name); + free_alloca(lowercase_name); return ret; } 1.2.2.1 +0 -4 Zend/zend_constants.h Index: zend_constants.h =================================================================== RCS file: /cvsroot/php-i18n/Zend/zend_constants.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -r1.2 -r1.2.2.1 --- zend_constants.h 29 Apr 2002 02:25:13 -0000 1.2 +++ zend_constants.h 9 Jul 2002 09:02:00 -0000 1.2.2.1 @@ -25,10 +25,6 @@ #define CONST_CS (1<<0) /* Case Sensitive */ #define CONST_PERSISTENT (1<<1) /* Persistent */ -#define CONST_EFREE_PERSISTENT (1<<2) /* In conjunction with CONST_PERSISTENT, - * means that the constant should be freed - * using zval_dtor() on shutdown. - */ typedef struct _zend_constant { zval value; 1.2.2.2 +3 -0 Zend/zend_execute.h Index: zend_execute.h =================================================================== RCS file: /cvsroot/php-i18n/Zend/zend_execute.h,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -u -r1.2.2.1 -r1.2.2.2 --- zend_execute.h 19 May 2002 11:10:23 -0000 1.2.2.1 +++ zend_execute.h 9 Jul 2002 09:02:00 -0000 1.2.2.2 @@ -27,6 +27,7 @@ #include "zend_operators.h" #include "zend_execute_globals.h" +BEGIN_EXTERN_C() ZEND_API extern void (*zend_execute)(zend_op_array *op_array TSRMLS_DC); void init_executor(TSRMLS_D); @@ -136,5 +137,7 @@ #define IS_OVERLOADED_OBJECT 1 #define IS_STRING_OFFSET 2 + +END_EXTERN_C() #endif /* ZEND_EXECUTE_H */ 1.2.2.3 +1 -2 Zend/zend_globals.h Index: zend_globals.h =================================================================== RCS file: /cvsroot/php-i18n/Zend/zend_globals.h,v retrieving revision 1.2.2.2 retrieving revision 1.2.2.3 diff -u -r1.2.2.2 -r1.2.2.3 --- zend_globals.h 19 May 2002 11:10:23 -0000 1.2.2.2 +++ zend_globals.h 9 Jul 2002 09:02:00 -0000 1.2.2.3 @@ -152,7 +152,7 @@ zend_op **opline_ptr; - zend_execute_data *execute_data_ptr; + zend_execute_data *execute_data_ptr; HashTable *active_symbol_table; HashTable symbol_table; /* main symbol table */ @@ -213,7 +213,6 @@ struct _zend_alloc_globals { zend_mem_header *head; /* standard list */ - zend_mem_header *phead; /* persistent list */ void *cache[MAX_CACHED_MEMORY][MAX_CACHED_ENTRIES]; unsigned int cache_count[MAX_CACHED_MEMORY]; void *fast_cache_list_head[MAX_FAST_CACHE_TYPES]; 1.2.2.1 +3 -3 Zend/zend_ini_scanner.l Index: zend_ini_scanner.l =================================================================== RCS file: /cvsroot/php-i18n/Zend/zend_ini_scanner.l,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -r1.2 -r1.2.2.1 --- zend_ini_scanner.l 29 Apr 2002 02:25:14 -0000 1.2 +++ zend_ini_scanner.l 9 Jul 2002 09:02:00 -0000 1.2.2.1 @@ -125,11 +125,11 @@ return CFG_FALSE; } -<INITIAL>[[][^[]+[\]]{NEWLINE}? { +<INITIAL>[[][^[]+[\]][ ]*{NEWLINE}? { /* SECTION */ - /* eat trailng ] */ - while (yyleng>0 && (yytext[yyleng-1]=='\n' || yytext[yyleng-1]=='\r' || yytext[yyleng-1]==']')) { + /* eat trailing ] and spaces */ + while (yyleng>0 && (yytext[yyleng-1]=='\n' || yytext[yyleng-1]=='\r' || yytext[yyleng-1]==']' || yytext[yyleng-1]==' ')) { yyleng--; yytext[yyleng]=0; } 1.2.2.3 +2 -1 Zend/zend_language_parser.y Index: zend_language_parser.y =================================================================== RCS file: /cvsroot/php-i18n/Zend/zend_language_parser.y,v retrieving revision 1.2.2.2 retrieving revision 1.2.2.3 diff -u -r1.2.2.2 -r1.2.2.3 --- zend_language_parser.y 19 May 2002 11:10:23 -0000 1.2.2.2 +++ zend_language_parser.y 9 Jul 2002 09:02:00 -0000 1.2.2.3 @@ -390,6 +390,7 @@ is_reference: /* empty */ { $$.op_type = ZEND_RETURN_VAL; } | '&' { $$.op_type = ZEND_RETURN_REF; } +; class_variable_decleration: class_variable_decleration ',' T_VARIABLE { zend_do_declare_property(&$3, NULL TSRMLS_CC); } @@ -533,7 +534,7 @@ static_scalar: /* compile-time evaluated scalars */ common_scalar { $$ = $1; } | T_STRING { zend_do_fetch_constant(&$$, &$1, ZEND_CT TSRMLS_CC); } - | '+' static_scalar { $$ = $1; } + | '+' static_scalar { $$ = $2; } | '-' static_scalar { zval minus_one; minus_one.type = IS_LONG; minus_one.value.lval = -1; mul_function(&$2.u.constant, &$2.u.constant, &minus_one TSRMLS_CC); $$ = $2; } | T_ARRAY '(' static_array_pair_list ')' { $$ = $3; $$.u.constant.type = IS_CONSTANT_ARRAY; } ; 1.2.2.1 +2 -0 Zend/zend_list.h Index: zend_list.h =================================================================== RCS file: /cvsroot/php-i18n/Zend/zend_list.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -r1.2 -r1.2.2.1 --- zend_list.h 29 Apr 2002 02:25:14 -0000 1.2 +++ zend_list.h 9 Jul 2002 09:02:00 -0000 1.2.2.1 @@ -24,6 +24,7 @@ #include "zend_hash.h" #include "zend_globals.h" +BEGIN_EXTERN_C() #define ZEND_RESOURCE_LIST_TYPE_STD 1 #define ZEND_RESOURCE_LIST_TYPE_EX 2 @@ -105,5 +106,6 @@ if (le_id == 0) { \ le_id = zend_fetch_list_dtor_id(le_type_name); \ } +END_EXTERN_C() #endif 1.2.2.1 +3 -0 Zend/zend_llist.c Index: zend_llist.c =================================================================== RCS file: /cvsroot/php-i18n/Zend/zend_llist.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -r1.2 -r1.2.2.1 --- zend_llist.c 29 Apr 2002 02:25:14 -0000 1.2 +++ zend_llist.c 9 Jul 2002 09:02:00 -0000 1.2.2.1 @@ -139,6 +139,9 @@ data = old_tail->data; l->tail = l->tail->prev; + if (l->dtor) { + l->dtor(data); + } pefree(old_tail, l->persistent); --l->count; 1.2.2.1 +1 -1 Zend/zend_modules.h Index: zend_modules.h =================================================================== RCS file: /cvsroot/php-i18n/Zend/zend_modules.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -r1.2 -r1.2.2.1 --- zend_modules.h 29 Apr 2002 02:25:14 -0000 1.2 +++ zend_modules.h 9 Jul 2002 09:02:00 -0000 1.2.2.1 @@ -34,7 +34,7 @@ ZEND_API extern unsigned char second_arg_force_ref[]; ZEND_API extern unsigned char third_arg_force_ref[]; -#define ZEND_MODULE_API_NO 20010901 +#define ZEND_MODULE_API_NO 20020429 #ifdef ZTS #define USING_ZTS 1 #else 1.2.2.1 +18 -10 Zend/zend_operators.c Index: zend_operators.c =================================================================== RCS file: /cvsroot/php-i18n/Zend/zend_operators.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -r1.2 -r1.2.2.1 --- zend_operators.c 29 Apr 2002 02:25:14 -0000 1.2 +++ zend_operators.c 9 Jul 2002 09:02:00 -0000 1.2.2.1 @@ -1501,6 +1501,7 @@ ZEND_API int decrement_function(zval *op1) { long lval; + double dval; switch (op1->type) { case IS_LONG: @@ -1520,16 +1521,23 @@ op1->value.lval = -1; op1->type = IS_LONG; break; - } else if (is_numeric_string(op1->value.str.val, op1->value.str.len, &lval, NULL, 0)==IS_LONG) { /* long */ - STR_FREE(op1->value.str.val); - if(lval == LONG_MIN) { - double d = (double)lval; - ZVAL_DOUBLE(op1, d-1); - } else { - op1->value.lval = lval-1; - op1->type = IS_LONG; - } - break; + } + switch(is_numeric_string(op1->value.str.val, op1->value.str.len, &lval, &dval, 0)) { + case IS_LONG: + STR_FREE(op1->value.str.val); + if(lval == LONG_MIN) { + double d = (double)lval; + ZVAL_DOUBLE(op1, d-1); + } else { + op1->value.lval = lval-1; + op1->type = IS_LONG; + } + break; + case IS_DOUBLE: + STR_FREE(op1->value.str.val); + op1->value.dval = dval - 1; + op1->type = IS_DOUBLE; + break; } break; default: 1.2.2.1 +0 -31 Zend/zend_variables.c Index: zend_variables.c =================================================================== RCS file: /cvsroot/php-i18n/Zend/zend_variables.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -r1.2 -r1.2.2.1 --- zend_variables.c 29 Apr 2002 02:25:14 -0000 1.2 +++ zend_variables.c 9 Jul 2002 09:02:00 -0000 1.2.2.1 @@ -133,37 +133,6 @@ } -ZEND_API int zval_persist(zval *zvalue TSRMLS_DC) -{ - switch (zvalue->type) { - case IS_OBJECT: - case IS_RESOURCE: - return FAILURE; /* resources and objects cannot be persisted */ - break; - case IS_BOOL: - case IS_LONG: - case IS_NULL: - break; - case IS_CONSTANT: - case IS_STRING: - if (zvalue->value.str.val) { - if (zvalue->value.str.len==0) { - zvalue->value.str.val = empty_string; - return SUCCESS; - } - } - persist_alloc(zvalue->value.str.val); - break; - case IS_ARRAY: - case IS_CONSTANT_ARRAY: - persist_alloc(zvalue->value.ht); - zend_hash_apply(zvalue->value.ht, (apply_func_t) zval_persist TSRMLS_CC); - break; - } - return SUCCESS; -} - - ZEND_API int zend_print_variable(zval *var) { return zend_print_zval(var, 0); 1.2.2.1 +0 -2 Zend/zend_variables.h Index: zend_variables.h =================================================================== RCS file: /cvsroot/php-i18n/Zend/zend_variables.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -r1.2 -r1.2.2.1 --- zend_variables.h 29 Apr 2002 02:25:14 -0000 1.2 +++ zend_variables.h 9 Jul 2002 09:02:00 -0000 1.2.2.1 @@ -32,8 +32,6 @@ #define zval_dtor(zvalue) _zval_dtor((zvalue) ZEND_FILE_LINE_CC) #define zval_ptr_dtor(zval_ptr) _zval_ptr_dtor((zval_ptr) ZEND_FILE_LINE_CC) -ZEND_API int zval_persist(zval *zvalue TSRMLS_DC); - #if ZEND_DEBUG ZEND_API int _zval_copy_ctor_wrapper(zval *zvalue); ZEND_API void _zval_dtor_wrapper(zval *zvalue);