summaryrefslogtreecommitdiff
path: root/Zend/zend_execute_API.c
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2002-01-20 20:42:15 +0000
committerAndi Gutmans <andi@php.net>2002-01-20 20:42:15 +0000
commit2131b019c74272faf484f2e2b3390b87f5ba9bd3 (patch)
tree30f2faac7b5c4c15f8d0075d68a179a7337ea851 /Zend/zend_execute_API.c
parentfe6e7058eedfc30ef766185aebc95e1e41437c45 (diff)
downloadphp-git-2131b019c74272faf484f2e2b3390b87f5ba9bd3.tar.gz
- Improve performance of functions that use $GLOBALS[]
- Please check this and make sure it doesn't break anything.
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r--Zend/zend_execute_API.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 8927b37084..12d28b1789 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -135,6 +135,16 @@ void init_executor(TSRMLS_D)
zend_ptr_stack_init(&EG(argument_stack));
zend_hash_init(&EG(symbol_table), 50, NULL, ZVAL_PTR_DTOR, 0);
+ {
+ zval *globals;
+
+ ALLOC_ZVAL(globals);
+ globals->refcount=1;
+ globals->is_ref=1;
+ globals->type = IS_ARRAY;
+ globals->value.ht = &EG(symbol_table);
+ zend_hash_update(&EG(symbol_table), "GLOBALS", sizeof("GLOBALS"), &globals, sizeof(zval *), NULL);
+ }
EG(active_symbol_table) = &EG(symbol_table);
zend_llist_apply(&zend_extensions, (llist_apply_func_t) zend_extension_activator TSRMLS_CC);