]> granicus.if.org Git - php/commitdiff
-More commits
authorAndi Gutmans <andi@php.net>
Mon, 26 Apr 1999 03:03:39 +0000 (03:03 +0000)
committerAndi Gutmans <andi@php.net>
Mon, 26 Apr 1999 03:03:39 +0000 (03:03 +0000)
Zend/zend-scanner.l
Zend/zend.c
Zend/zend_alloc.c
Zend/zend_globals.h

index 2bb70c71c30a721718f4eaf2b2584f70ada4b80b..86bd11f2db1e0e46a2236d918ff9d66924af4988 100644 (file)
@@ -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()
index d9a99eabc492646d3f0142f7d5e0b83d4906e28d..448d43051bf953fb8dd2427dd3b8b7033894bbda 100644 (file)
@@ -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();
index 9326ce876ab63ef149a9ea8cb707c6e4c01d4d94..45cace4c4e334801a8275f70bf912d96e8077ba5 100644 (file)
@@ -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
index 644e7e3d4380232a23047f8560758705f3042a74..66f9100d0833dc0a05f5fe8ed32a7c32c276a7b5 100644 (file)
@@ -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"