summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>1999-04-26 03:03:39 +0000
committerAndi Gutmans <andi@php.net>1999-04-26 03:03:39 +0000
commitdf6134bc42f279088972d9b19ac560d9e11fd4c9 (patch)
tree4ec8db2dea7c52daba3c529dcf41efdbea7373e0
parent9c51acdc175e90927b5a5a22a0c0e06ef66bd461 (diff)
downloadphp-git-df6134bc42f279088972d9b19ac560d9e11fd4c9.tar.gz
-More commits
-rw-r--r--Zend/zend-scanner.l4
-rw-r--r--Zend/zend.c2
-rw-r--r--Zend/zend_alloc.c10
-rw-r--r--Zend/zend_globals.h2
4 files changed, 14 insertions, 4 deletions
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"