From: Andi Gutmans Date: Mon, 26 Apr 1999 03:03:39 +0000 (+0000) Subject: -More commits X-Git-Tag: BEFORE_PHP4_APACHE_MODULE_CHANGE~146 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df6134bc42f279088972d9b19ac560d9e11fd4c9;p=php -More commits --- diff --git a/Zend/zend-scanner.l b/Zend/zend-scanner.l index 2bb70c71c3..86bd11f2db 100644 --- a/Zend/zend-scanner.l +++ b/Zend/zend-scanner.l @@ -169,16 +169,16 @@ inline int open_file_for_scanning(zend_file_handle *file_handle CLS_DC) /* Reset the scanner for scanning the new file */ yyin = tmp; yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE)); - CG(zend_lineno) = 1; BEGIN(INITIAL); - zend_set_compiled_filename(file_handle->filename); #else ifstream *input_file = new ifstream(file_handle->filename); CG(ZFL) = new ZendFlexLexer; CG(ZFL)->switch_streams(input_file, &cout); #endif + zend_set_compiled_filename(file_handle->filename); + CG(zend_lineno) = 1; return SUCCESS; } END_EXTERN_C() diff --git a/Zend/zend.c b/Zend/zend.c index d9a99eabc4..448d43051b 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -219,7 +219,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions) zend_executor_globals *executor_globals; tsrm_startup(1,1,0); - alloc_globals_id = ts_allocate_id(sizeof(zend_alloc_globals), NULL, NULL); + alloc_globals_id = ts_allocate_id(sizeof(zend_alloc_globals), alloc_globals_ctor, NULL); #endif start_memory_manager(); diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 9326ce876a..45cace4c4e 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -516,6 +516,16 @@ ZEND_API void _persist_alloc(void *ptr) HANDLE_UNBLOCK_INTERRUPTIONS(); } + +#ifdef ZTS + +void alloc_globals_ctor(zend_alloc_globals *alloc_globals) +{ + start_memory_manager(); +} + + +#endif /* * Local variables: * tab-width: 4 diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index 644e7e3d43..66f9100d08 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -101,6 +101,7 @@ extern ZEND_API zend_executor_globals executor_globals; # define ALS_CC , ALS_C # define AG(v) (((zend_alloc_globals *) alloc_globals)->v) # define ALS_FETCH() zend_alloc_globals *alloc_globals = (zend_alloc_globals *) ts_resource(alloc_globals_id) +void alloc_globals_ctor(zend_alloc_globals *alloc_globals); #else # define ALS_D # define ALS_DC @@ -110,7 +111,6 @@ extern ZEND_API zend_executor_globals executor_globals; # define ALS_FETCH() #endif - #include "zend_compile.h" #include "zend_execute.h"