summaryrefslogtreecommitdiff
path: root/processor
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2014-11-10 11:07:01 +0000
committerXuefer <xuefer@gmail.com>2014-11-10 11:07:01 +0000
commit51accff949c03c54a1f5fef4c54e2aa61feb00ba (patch)
treef1047f9923d4511b6ea4adbdaae7333ad73f919f /processor
parent6c397c70ecd8a7a4e67dd347614ee4571c2830fd (diff)
downloadxcache-51accff949c03c54a1f5fef4c54e2aa61feb00ba.tar.gz
xcache-51accff949c03c54a1f5fef4c54e2aa61feb00ba.zip
fix build for older PHP
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1561 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
Diffstat (limited to 'processor')
-rw-r--r--processor/foot.m42
-rw-r--r--processor/processor.m48
-rw-r--r--processor/var-helper-t.h3
-rw-r--r--processor/var-helper.h11
4 files changed, 12 insertions, 12 deletions
diff --git a/processor/foot.m4 b/processor/foot.m4
index 31cd2c7..ff614ef 100644
--- a/processor/foot.m4
+++ b/processor/foot.m4
@@ -153,7 +153,7 @@ EXPORTED_FUNCTION(`zval *xc_processor_restore_var(zval *dst, const xc_entry_var_
#ifdef ZEND_ENGINE_2
if (src->objects_count) {
for (i = 0; i < src->objects_count; ++i) {
- zend_objects_store_del_ref_by_handle_ex(processor.object_handles[i], NULL TSRMLS_CC);
+ zend_objects_store_del_ref_by_handle(processor.object_handles[i] TSRMLS_CC);
}
efree(processor.object_handles);
}
diff --git a/processor/processor.m4 b/processor/processor.m4
index 696add7..c33999c 100644
--- a/processor/processor.m4
+++ b/processor/processor.m4
@@ -1424,10 +1424,6 @@ DEF_STRUCT_P_FUNC(`xc_entry_var_t', , `dnl {{{
SRC(objects) = xc_vector_detach(zend_object, &processor->objects);
popdef(`src')
xc_vector_destroy(&processor->objects);
- if (SRC(`objects_count')) {
- xc_vector_init(xc_constant_string_t, &processor->class_names, 0);
- zend_hash_init(&processor->class_name_to_index, 0, NULL, NULL, 0);
- }
')
dnl must be after calc .value
PROCESS(zend_uint, objects_count)
@@ -1457,10 +1453,6 @@ DEF_STRUCT_P_FUNC(`xc_entry_var_t', , `dnl {{{
IFSTORE(`
/* no longer needed */
if (vsrc->class_names_count) {
- dnl size_t i;
- dnl for (i = 0; i < vsrc->class_names_count; ++i) {
- dnl efree(vsrc->class_names[i]);
- dnl }
efree(vsrc->class_names);
vsrc->class_names_count = 0;
vsrc->class_names = NULL;
diff --git a/processor/var-helper-t.h b/processor/var-helper-t.h
index 12c2a81..25ef538 100644
--- a/processor/var-helper-t.h
+++ b/processor/var-helper-t.h
@@ -1,8 +1,9 @@
/* {{{ var object helpers */
-zend_bool have_objects;
+#ifdef ZEND_ENGINE_2
xc_vector_t objects; /* in calc only */
HashTable handle_to_index; /* in calc/store only */
zend_object_handle *object_handles; /* in restore only */
+#endif
const xc_entry_var_t *entry_var_src; /* in restore */
xc_vector_t class_names; /* in calc only */
diff --git a/processor/var-helper.h b/processor/var-helper.h
index 852f891..700dfb4 100644
--- a/processor/var-helper.h
+++ b/processor/var-helper.h
@@ -1,13 +1,14 @@
#ifdef ZEND_ENGINE_2
static void xc_var_collect_object(xc_processor_t *processor, zend_object_handle handle TSRMLS_DC) /* {{{ */
{
- size_t next_index = xc_vector_size(&processor->objects);
+ size_t next_index;
if (!xc_vector_initialized(&processor->objects)) {
xc_vector_init(zend_object, &processor->objects, 0);
zend_hash_init(&processor->handle_to_index, 0, NULL, NULL, 0);
}
+ next_index = xc_vector_size(&processor->objects);
if (_zend_hash_index_update_or_next_insert(&processor->handle_to_index, handle, (void *) &next_index, sizeof(next_index), NULL, HASH_ADD ZEND_FILE_LINE_CC) == SUCCESS) {
zend_object *object = zend_object_store_get_object_by_handle(handle TSRMLS_CC);
xc_vector_push_back(&processor->objects, object);
@@ -36,8 +37,14 @@ static zend_object_handle xc_var_restore_handle(xc_processor_t *processor, size_
#endif
static void xc_var_collect_class(xc_processor_t *processor, zend_class_entry *ce TSRMLS_DC) /* {{{ */
{
- size_t next_index = xc_vector_size(&processor->class_names);
+ size_t next_index;
+ if (!xc_vector_initialized(&processor->class_names)) {
+ xc_vector_init(xc_constant_string_t, &processor->class_names, 0);
+ zend_hash_init(&processor->class_name_to_index, 0, NULL, NULL, 0);
+ }
+
+ next_index = xc_vector_size(&processor->class_names);
if (zend_hash_add(&processor->class_name_to_index, ce->name, ce->name_length, (void *) &next_index, sizeof(next_index), NULL) == SUCCESS) {
xc_constant_string_t class_name;
class_name.str = (char *) ce->name;