Browse Source

PHP_4: fix build

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@508 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.0
Xuefer 14 years ago
parent
commit
470c2fcee8
  1. 2
      const_string.c
  2. 2
      processor/processor.m4
  3. 2
      utils.c
  4. 8
      xcache.c
  5. 2
      xcache_globals.h

2
const_string.c

@ -69,6 +69,8 @@ const char *xc_get_data_type(zend_uchar data_type)
# include "const_string_opcodes_php5.1.h"
#elif defined(ZEND_ENGINE_2)
# include "const_string_opcodes_php5.0.h"
#else
# include "const_string_opcodes_php4.x.h"
#endif
zend_uchar xc_get_opcode_count()

2
processor/processor.m4

@ -508,8 +508,10 @@ DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{
dst->refcount[0] = 1000;
/* deep */
STRUCT_P(HashTable, static_variables, HashTable_zval_ptr)
#ifdef ZEND_ENGINE_2
STRUCT_ARRAY_I(num_args, zend_arg_info, arg_info)
xc_gc_add_op_array(dst TSRMLS_CC);
#endif
define(`SKIPASSERT_ONCE')
}
else

2
utils.c

@ -786,6 +786,7 @@ void xc_sandbox_free(xc_sandbox_t *sandbox, xc_install_action_t install TSRMLS_D
/* restore orig here, as EG/CG holded tmp before */
memcpy(&EG(included_files), &OG(included_files), sizeof(EG(included_files)));
#ifdef E_STRICT
if (sandbox->compilererrors) {
int i;
for (i = 0; i < sandbox->compilererror_cnt; i ++) {
@ -793,6 +794,7 @@ void xc_sandbox_free(xc_sandbox_t *sandbox, xc_install_action_t install TSRMLS_D
}
efree(sandbox->compilererrors);
}
#endif
if (sandbox->alloc) {
efree(sandbox);
}

8
xcache.c

@ -1481,6 +1481,7 @@ int xc_is_shm(const void *p) /* {{{ */
}
/* }}} */
#ifdef ZEND_ENGINE_2
/* {{{ xc_gc_op_array_t */
typedef struct {
zend_uint num_args;
@ -1492,7 +1493,9 @@ void xc_gc_add_op_array(zend_op_array *op_array TSRMLS_DC) /* {{{ */
xc_gc_op_array_t gc_op_array;
gc_op_array.num_args = op_array->num_args;
gc_op_array.arg_info = op_array->arg_info;
#ifdef ZEND_ENGINE_2
zend_hash_next_index_insert(&XG(gc_op_arrays), (void *) &gc_op_array, sizeof(gc_op_array), NULL);
#endif
}
/* }}} */
static void xc_gc_op_array(void *pDest) /* {{{ */
@ -1510,6 +1513,7 @@ static void xc_gc_op_array(void *pDest) /* {{{ */
}
}
/* }}} */
#endif
/* module helper function */
static int xc_init_constant(int module_number TSRMLS_DC) /* {{{ */
@ -1743,7 +1747,9 @@ static void xc_request_init(TSRMLS_D) /* {{{ */
}
}
#ifdef ZEND_ENGINE_2
zend_hash_init(&XG(gc_op_arrays), 32, NULL, xc_gc_op_array, 0);
#endif
#if PHP_API_VERSION <= 20041225
XG(request_time) = time(NULL);
@ -1759,7 +1765,9 @@ static void xc_request_init(TSRMLS_D) /* {{{ */
static void xc_request_shutdown(TSRMLS_D) /* {{{ */
{
xc_entry_unholds(TSRMLS_C);
#ifdef ZEND_ENGINE_2
zend_hash_destroy(&XG(gc_op_arrays));
#endif
xc_gc_expires_php(TSRMLS_C);
xc_gc_expires_var(TSRMLS_C);
xc_gc_deletes(TSRMLS_C);

2
xcache_globals.h

@ -17,7 +17,9 @@ ZEND_BEGIN_MODULE_GLOBALS(xcache)
time_t request_time;
long var_ttl;
#ifdef ZEND_ENGINE_2
HashTable gc_op_arrays;
#endif
HashTable internal_function_table;
HashTable internal_class_table;

Loading…
Cancel
Save