summaryrefslogtreecommitdiff
path: root/Zend/zend_execute.c
diff options
context:
space:
mode:
authorDerick Rethans <github@derickrethans.nl>2012-10-04 08:38:56 +0100
committerDerick Rethans <github@derickrethans.nl>2012-10-04 08:38:56 +0100
commit61bee020e1fabc7ac8915025bff5e7b773382156 (patch)
tree3f45b89caedc1bfb06faccd66d1d8ed3ebfad512 /Zend/zend_execute.c
parent7101e9161c9c2bf9d843d1f412915e08072b198f (diff)
parent9b2303afd60eff6c9f3291bbe412c9734475b43a (diff)
downloadphp-git-61bee020e1fabc7ac8915025bff5e7b773382156.tar.gz
Merge branch 'master' of git.php.net:/php-src
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r--Zend/zend_execute.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index fbc73258c7..149b91233c 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -35,6 +35,7 @@
#include "zend_exceptions.h"
#include "zend_interfaces.h"
#include "zend_closures.h"
+#include "zend_generators.h"
#include "zend_vm.h"
#include "zend_dtrace.h"
@@ -1536,6 +1537,50 @@ ZEND_API zval **zend_get_zval_ptr_ptr(int op_type, const znode_op *node, const t
return get_zval_ptr_ptr(op_type, node, Ts, should_free, type);
}
+void zend_clean_and_cache_symbol_table(HashTable *symbol_table TSRMLS_DC) /* {{{ */
+{
+ if (EG(symtable_cache_ptr) >= EG(symtable_cache_limit)) {
+ zend_hash_destroy(symbol_table);
+ FREE_HASHTABLE(symbol_table);
+ } else {
+ /* clean before putting into the cache, since clean
+ could call dtors, which could use cached hash */
+ zend_hash_clean(symbol_table);
+ *(++EG(symtable_cache_ptr)) = symbol_table;
+ }
+}
+/* }}} */
+
+void zend_free_compiled_variables(zval ***CVs, int num) /* {{{ */
+{
+ int i;
+ for (i = 0; i < num; ++i) {
+ if (CVs[i]) {
+ zval_ptr_dtor(CVs[i]);
+ }
+ }
+}
+/* }}} */
+
+void** zend_copy_arguments(void **arguments_end) /* {{{ */
+{
+ int arguments_count = (int) (zend_uintptr_t) *arguments_end;
+ size_t arguments_size = (arguments_count + 1) * sizeof(void **);
+ void **arguments_start = arguments_end - arguments_count;
+ void **copied_arguments_start = emalloc(arguments_size);
+ void **copied_arguments_end = copied_arguments_start + arguments_count;
+ int i;
+
+ memcpy(copied_arguments_start, arguments_start, arguments_size);
+
+ for (i = 0; i < arguments_count; i++) {
+ Z_ADDREF_P((zval *) arguments_start[i]);
+ }
+
+ return copied_arguments_end;
+}
+/* }}} */
+
/*
* Local variables:
* tab-width: 4