Browse Source

merged r504:513 from trunk

git-svn-id: svn://svn.lighttpd.net/xcache/branches/1.3@622 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
1.3
Xuefer 12 years ago
parent
commit
6a5fa6a923
  1. 2
      const_string.c
  2. 2
      disassembler.c
  3. 2
      processor/hashtable.m4
  4. 50
      processor/head.m4
  5. 2
      processor/main.m4
  6. 27
      processor/processor.m4
  7. 15
      processor/string.m4
  8. 29
      utils.c
  9. 6
      utils.h
  10. 1
      xcache-test.ini
  11. 26
      xcache.c
  12. 10
      xcache.h
  13. 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
disassembler.c

@ -65,7 +65,7 @@ static void xc_dasm(zval *dst, zend_op_array *op_array TSRMLS_DC) /* {{{ */
keysize ++;
}
}
add_u_assoc_zval_ex(list, BUCKET_KEY_TYPE(b), buf, b->nKeyLength, zv);
add_u_assoc_zval_ex(list, BUCKET_KEY_TYPE(b), ZSTR(buf), b->nKeyLength, zv);
}
efree(buf);
add_assoc_zval_ex(dst, ZEND_STRS("class_table"), list);

2
processor/hashtable.m4

@ -59,7 +59,7 @@ define(`DEF_HASH_TABLE_FUNC', `
keysize ++;
}
}
add_u_assoc_zval_ex(dst, BUCKET_KEY_TYPE(b), buf, keysize, zv);
add_u_assoc_zval_ex(dst, BUCKET_KEY_TYPE(b), ZSTR(buf), keysize, zv);
}
')

50
processor/head.m4

@ -113,12 +113,7 @@ static inline int xc_zstrlen_char(zstr s)
/* {{{ xc_zstrlen_uchar */
static inline int xc_zstrlen_uchar(zstr s)
{
int i;
UChar *p = ZSTR_U(s);
for (i = 0; *p; i ++, p++) {
/* empty */
}
return i;
return u_strlen(ZSTR_U(s));
}
/* }}} */
/* {{{ xc_zstrlen */
@ -214,10 +209,11 @@ static zend_class_entry *xc_get_class(xc_processor_t *processor, zend_ulong clas
/* }}} */
#ifdef ZEND_ENGINE_2
/* fix method on store */
static void xc_fix_method(xc_processor_t *processor, zend_op_array *dst) /* {{{ */
static void xc_fix_method(xc_processor_t *processor, zend_op_array *dst TSRMLS_DC) /* {{{ */
{
zend_function *zf = (zend_function *) dst;
zend_class_entry *ce = processor->active_class_entry_dst;
const zend_class_entry *srcce = processor->active_class_entry_src;
/* Fixing up the default functions for objects here since
* we need to compare with the newly allocated functions
@ -238,16 +234,7 @@ static void xc_fix_method(xc_processor_t *processor, zend_op_array *dst) /* {{{
ce->clone = zf;
}
else {
dnl FIXME: handle common.function_name here
#define SET_IF_SAME_NAME(member) \
do { \
if (!strcasecmp(ZSTR_S(zf->common.function_name), #member)) { \
ce->member = zf; \
} \
} \
while(0)
/* if(ce->member && !strcmp(zf->common.function_name, ce->member->common.function_name)) { \ */
pushdef(`SET_IF_SAME_NAMEs', `
SET_IF_SAME_NAME(__get);
SET_IF_SAME_NAME(__set);
#ifdef ZEND_ENGINE_2_1
@ -261,8 +248,37 @@ dnl FIXME: handle common.function_name here
#if defined(ZEND_ENGINE_2_2) || PHP_MAJOR_VERSION >= 6
SET_IF_SAME_NAME(__tostring);
#endif
')
#ifdef IS_UNICODE
if (UG(unicode)) {
#define SET_IF_SAME_NAME(member) \
do { \
if (srcce->member && u_strcmp(ZSTR_U(zf->common.function_name), ZSTR_U(srcce->member->common.function_name)) == 0) { \
ce->member = zf; \
} \
} \
while(0)
SET_IF_SAME_NAMEs()
#undef SET_IF_SAME_NAME
}
else
#endif
do {
#define SET_IF_SAME_NAME(member) \
do { \
if (srcce->member && strcmp(ZSTR_S(zf->common.function_name), ZSTR_S(srcce->member->common.function_name)) == 0) { \
ce->member = zf; \
} \
} \
while(0)
SET_IF_SAME_NAMEs()
#undef SET_IF_SAME_NAME
} while (0);
popdef(`SET_IF_SAME_NAMEs')
}
}
/* }}} */

2
processor/main.m4

@ -110,7 +110,7 @@ define(`PROC_CLASS_ENTRY_P_EX', `
if ($2) {
IFSTORE(`$1 = (zend_class_entry *) xc_get_class_num(processor, $2);')
IFRESTORE(`$1 = xc_get_class(processor, (zend_ulong) $2);')
IFDASM(`add_assoc_stringl_ex(dst, ZEND_STRS("$3"), $2->name, strlen($2->name), 1);')
IFDASM(`add_assoc_unicodel_ex(dst, ZEND_STRS("$3"), ZSTR_U($2->name), $2->name_length, 1);')
}
else {
COPYNULL_EX(`$1', `$3')

27
processor/processor.m4

@ -56,9 +56,7 @@ dnl }}}
dnl {{{ zend_brk_cont_element
DEF_STRUCT_P_FUNC(`zend_brk_cont_element', , `
#ifdef ZEND_ENGINE_2_2
#ifndef IS_UNICODE
DISPATCH(int, start)
#endif
#endif
DISPATCH(int, cont)
DISPATCH(int, brk)
@ -242,7 +240,7 @@ DEF_STRUCT_P_FUNC(`zend_constant', , `dnl {{{
DISPATCH(uint, name_len)
pushdef(`emalloc', `malloc($1)')
pushdef(`ecalloc', `calloc($1, $2)')
PROC_ZSTRING_L(, name, name_len)
PROC_ZSTRING_N(, name, name_len)
popdef(`ecalloc')
popdef(`emalloc')
DISPATCH(int, module_number)
@ -282,7 +280,7 @@ DEF_STRUCT_P_FUNC(`zend_property_info', , `
PROC_ZSTRING_L(, doc_comment, doc_comment_len)
#endif
dnl isnt in php6 yet
#if defined(ZEND_ENGINE_2_2) && !defined(IS_UNICODE)
#if defined(ZEND_ENGINE_2_2)
PROC_CLASS_ENTRY_P(ce)
#endif
')
@ -510,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
@ -645,7 +645,7 @@ DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{
if (src->prototype != NULL
&& zend_u_hash_find(&(processor->active_class_entry_dst->parent->function_table),
UG(unicode) ? IS_UNICODE : IS_STRING,
src->function_name, xc_zstrlen(UG(unicode), src->function_name) + 1,
src->function_name, xc_zstrlen(UG(unicode) ? IS_UNICODE : IS_STRING, src->function_name) + 1,
(void **) &parent) == SUCCESS) {
/* see do_inherit_method_check() */
if ((parent->common.fn_flags & ZEND_ACC_ABSTRACT)) {
@ -669,19 +669,14 @@ DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{
')
#endif
IFRESTORE(`
#ifdef ZEND_ENGINE_2
PROC_CLASS_ENTRY_P(scope)
IFCOPY(`
if (src->scope) {
dst->scope = xc_get_class(processor, (zend_ulong) src->scope);
xc_fix_method(processor, dst);
xc_fix_method(processor, dst TSRMLS_CC);
}
DONE(scope)
#endif
', `
#ifdef ZEND_ENGINE_2
PROC_CLASS_ENTRY_P(scope)
#endif
')
#endif
IFRESTORE(`
if (xc_have_op_array_ctor) {
@ -700,6 +695,7 @@ DEF_STRUCT_P_FUNC(`xc_constinfo_t', , `dnl {{{
IFRESTORE(`COPY(key)', `
PROC_ZSTRING_N(type, key, key_size)
')
DISPATCH(ulong, h)
STRUCT(zend_constant, constant)
')
dnl }}}
@ -712,6 +708,7 @@ DEF_STRUCT_P_FUNC(`xc_funcinfo_t', , `dnl {{{
IFRESTORE(`COPY(key)', `
PROC_ZSTRING_N(type, key, key_size)
')
DISPATCH(ulong, h)
STRUCT(zend_function, func)
')
dnl }}}
@ -723,6 +720,7 @@ DEF_STRUCT_P_FUNC(`xc_classinfo_t', , `dnl {{{
IFRESTORE(`COPY(key)', `
PROC_ZSTRING_N(type, key, key_size)
')
DISPATCH(ulong, h)
#ifdef ZEND_ENGINE_2
STRUCT_P(zend_class_entry, cest)
#else
@ -740,6 +738,7 @@ DEF_STRUCT_P_FUNC(`xc_autoglobal_t', , `dnl {{{
IFRESTORE(`COPY(key)', `
PROC_ZSTRING_L(type, key, key_len)
')
DISPATCH(ulong, h)
')
dnl }}}
#endif

15
processor/string.m4

@ -38,7 +38,7 @@ define(`PROC_STRING_N_EX', `
int usecopy;
INIT_ZVAL(zv);
ZVAL_UNICODEL(&zv, (UChar *) ($2), $3 - 1, 1);
ZVAL_UNICODEL(&zv, ZSTR_U($2), $3 - 1, 1);
zend_make_printable_zval(&zv, &reszv, &usecopy);
fprintf(stderr, "string:%s:\t\"", "$1");
xc_dprint_str_len(Z_STRVAL(reszv), Z_STRLEN(reszv));
@ -63,11 +63,16 @@ define(`PROC_STRING_N_EX', `
')
FIXPOINTER_EX(`PTRTYPE', DSTPTR)
IFDASM(`
ifelse(STRTYPE,zstr_uchar, `
add_assoc_unicodel_ex(dst, ZEND_STRS("$4"), $2, $3-1, 1);
', ` dnl else
add_assoc_stringl_ex(dst, ZEND_STRS("$4"), $2, $3-1, 1);')
ifelse(STRTYPE,zstr_uchar, `
add_assoc_unicodel_ex(dst, ZEND_STRS("$4"), ZSTR_U($2), $3-1, 1);
', ` dnl else
ifelse(STRTYPE,zstr_char, `
add_assoc_stringl_ex(dst, ZEND_STRS("$4"), ZSTR_S($2), $3-1, 1);
', `
add_assoc_stringl_ex(dst, ZEND_STRS("$4"), $2, $3-1, 1);
')
')
')
}
popdef(`DSTPTR')
popdef(`SRCPTR')

29
utils.c

@ -424,7 +424,7 @@ static int xc_do_early_binding(zend_op_array *op_array, HashTable *class_table,
/* }}} */
#ifdef HAVE_XCACHE_CONSTANT
void xc_install_constant(char *filename, zend_constant *constant, zend_uchar type, zstr key, uint len TSRMLS_DC) /* {{{ */
void xc_install_constant(char *filename, zend_constant *constant, zend_uchar type, zstr key, uint len, ulong h TSRMLS_DC) /* {{{ */
{
if (zend_u_hash_add(EG(zend_constants), type, key, len,
constant, sizeof(zend_constant),
@ -444,7 +444,7 @@ void xc_install_constant(char *filename, zend_constant *constant, zend_uchar typ
}
/* }}} */
#endif
void xc_install_function(char *filename, zend_function *func, zend_uchar type, zstr key, uint len TSRMLS_DC) /* {{{ */
void xc_install_function(char *filename, zend_function *func, zend_uchar type, zstr key, uint len, ulong h TSRMLS_DC) /* {{{ */
{
zend_bool istmpkey;
@ -474,7 +474,7 @@ void xc_install_function(char *filename, zend_function *func, zend_uchar type, z
}
}
/* }}} */
ZESW(xc_cest_t *, void) xc_install_class(char *filename, xc_cest_t *cest, int oplineno, zend_uchar type, zstr key, uint len TSRMLS_DC) /* {{{ */
ZESW(xc_cest_t *, void) xc_install_class(char *filename, xc_cest_t *cest, int oplineno, zend_uchar type, zstr key, uint len, ulong h TSRMLS_DC) /* {{{ */
{
zend_bool istmpkey;
zend_class_entry *cep = CestToCePtr(*cest);
@ -486,7 +486,7 @@ ZESW(xc_cest_t *, void) xc_install_class(char *filename, xc_cest_t *cest, int op
istmpkey = ZSTR_S(key)[0] == 0;
#endif
if (istmpkey) {
zend_u_hash_update(CG(class_table), type, key, len,
zend_u_hash_quick_update(CG(class_table), type, key, len, h,
cest, sizeof(xc_cest_t),
ZESW(&stored_ce_ptr, NULL)
);
@ -494,7 +494,7 @@ ZESW(xc_cest_t *, void) xc_install_class(char *filename, xc_cest_t *cest, int op
xc_do_early_binding(CG(active_op_array), CG(class_table), oplineno TSRMLS_CC);
}
}
else if (zend_u_hash_add(CG(class_table), type, key, len,
else if (zend_u_hash_quick_add(CG(class_table), type, key, len, h,
cest, sizeof(xc_cest_t),
ZESW(&stored_ce_ptr, NULL)
) == FAILURE) {
@ -540,15 +540,6 @@ static int xc_auto_global_arm(zend_auto_global *auto_global TSRMLS_DC) /* {{{ */
/* }}} */
#endif
void xc_zend_class_add_ref(zend_class_entry ZESW(*ce, **ce))
{
#ifdef ZEND_ENGINE_2
(*ce)->refcount++;
#else
(*ce->refcount)++;
#endif
}
xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, char *filename TSRMLS_DC) /* {{{ */
{
HashTable *h;
@ -591,7 +582,7 @@ xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, char *filename TSRMLS_DC) /
zend_hash_init_ex(&TG(function_table), 128, NULL, h->pDestructor, h->persistent, h->bApplyProtection);
{
zend_function tmp_func;
zend_hash_copy(&TG(function_table), &XG(internal_function_table), (copy_ctor_func_t) function_add_ref, (void *) &tmp_func, sizeof(tmp_func));
zend_hash_copy(&TG(function_table), &XG(internal_function_table), NULL, (void *) &tmp_func, sizeof(tmp_func));
}
TG(internal_function_tail) = TG(function_table).pListTail;
@ -600,7 +591,7 @@ xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, char *filename TSRMLS_DC) /
#if 0 && TODO
{
xc_cest_t tmp_cest;
zend_hash_copy(&TG(class_table), &XG(internal_class_table), (copy_ctor_func_t) xc_zend_class_add_ref, (void *) &tmp_cest, sizeof(tmp_cest));
zend_hash_copy(&TG(class_table), &XG(internal_class_table), NULL, (void *) &tmp_cest, sizeof(tmp_cest));
}
#endif
TG(internal_class_tail) = TG(class_table).pListTail;
@ -644,7 +635,7 @@ static void xc_sandbox_install(xc_sandbox_t *sandbox, xc_install_action_t instal
while (b != NULL) {
zend_constant *c = (zend_constant*) b->pData;
xc_install_constant(sandbox->filename, c,
BUCKET_KEY_TYPE(b), ZSTR(BUCKET_KEY_S(b)), b->nKeyLength TSRMLS_CC);
BUCKET_KEY_TYPE(b), ZSTR(BUCKET_KEY_S(b)), b->nKeyLength, b->h TSRMLS_CC);
b = b->pListNext;
}
#endif
@ -654,7 +645,7 @@ static void xc_sandbox_install(xc_sandbox_t *sandbox, xc_install_action_t instal
while (b != NULL) {
zend_function *func = (zend_function*) b->pData;
xc_install_function(sandbox->filename, func,
BUCKET_KEY_TYPE(b), ZSTR(BUCKET_KEY_S(b)), b->nKeyLength TSRMLS_CC);
BUCKET_KEY_TYPE(b), ZSTR(BUCKET_KEY_S(b)), b->nKeyLength, b->h TSRMLS_CC);
b = b->pListNext;
}
@ -662,7 +653,7 @@ static void xc_sandbox_install(xc_sandbox_t *sandbox, xc_install_action_t instal
/* install class */
while (b != NULL) {
xc_install_class(sandbox->filename, (xc_cest_t*) b->pData, -1,
BUCKET_KEY_TYPE(b), ZSTR(BUCKET_KEY_S(b)), b->nKeyLength TSRMLS_CC);
BUCKET_KEY_TYPE(b), ZSTR(BUCKET_KEY_S(b)), b->nKeyLength, b->h TSRMLS_CC);
b = b->pListNext;
}

6
utils.h

@ -71,10 +71,10 @@ int xc_foreach_early_binding_class(zend_op_array *op_array, void (*callback)(zen
/* installer */
#ifdef HAVE_XCACHE_CONSTANT
void xc_install_constant(char *filename, zend_constant *constant, zend_uchar type, zstr key, uint len TSRMLS_DC);
void xc_install_constant(char *filename, zend_constant *constant, zend_uchar type, zstr key, uint len, ulong h TSRMLS_DC);
#endif
void xc_install_function(char *filename, zend_function *func, zend_uchar type, zstr key, uint len TSRMLS_DC);
ZESW(xc_cest_t *, void) xc_install_class(char *filename, xc_cest_t *cest, int oplineno, zend_uchar type, zstr key, uint len TSRMLS_DC);
void xc_install_function(char *filename, zend_function *func, zend_uchar type, zstr key, uint len, ulong h TSRMLS_DC);
ZESW(xc_cest_t *, void) xc_install_class(char *filename, xc_cest_t *cest, int oplineno, zend_uchar type, zstr key, uint len, ulong h TSRMLS_DC);
/* sandbox */
typedef struct {

1
xcache-test.ini

@ -1,4 +1,5 @@
auto_globals_jit = Off
memory_limit = 256M
[xcache]
zend_extension_debug_ts=./modules/xcache.so

26
xcache.c

@ -555,7 +555,7 @@ static zend_op_array *xc_entry_install(xc_entry_t *xce, zend_file_handle *h TSRM
for (i = 0; i < p->constinfo_cnt; i ++) {
xc_constinfo_t *ci = &p->constinfos[i];
xc_install_constant(xce->name.str.val, &ci->constant,
UNISW(0, ci->type), ci->key, ci->key_size TSRMLS_CC);
UNISW(0, ci->type), ci->key, ci->key_size, ci->h TSRMLS_CC);
}
#endif
@ -563,7 +563,7 @@ static zend_op_array *xc_entry_install(xc_entry_t *xce, zend_file_handle *h TSRM
for (i = 0; i < p->funcinfo_cnt; i ++) {
xc_funcinfo_t *fi = &p->funcinfos[i];
xc_install_function(xce->name.str.val, &fi->func,
UNISW(0, fi->type), fi->key, fi->key_size TSRMLS_CC);
UNISW(0, fi->type), fi->key, fi->key_size, fi->h TSRMLS_CC);
}
/* install class */
@ -580,7 +580,7 @@ static zend_op_array *xc_entry_install(xc_entry_t *xce, zend_file_handle *h TSRM
new_cest_ptrs[i] =
#endif
xc_install_class(xce->name.str.val, &ci->cest, ci->oplineno,
UNISW(0, ci->type), ci->key, ci->key_size TSRMLS_CC);
UNISW(0, ci->type), ci->key, ci->key_size, ci->h TSRMLS_CC);
}
#ifdef ZEND_ENGINE_2_1
@ -589,7 +589,7 @@ static zend_op_array *xc_entry_install(xc_entry_t *xce, zend_file_handle *h TSRM
xc_autoglobal_t *aginfo = &p->autoglobals[i];
/*
zend_auto_global *auto_global;
if (zend_u_hash_find(CG(auto_globals), aginfo->type, aginfo->key, aginfo->key_len+1, (void **) &auto_global)==SUCCESS) {
if (zend_u_hash_quick_find(CG(auto_globals), aginfo->type, aginfo->key, aginfo->key_len+1, aginfo->h, (void **) &auto_global)==SUCCESS) {
if (auto_global->armed) {
auto_global->armed = auto_global->auto_global_callback(auto_global->name, auto_global->name_len TSRMLS_CC);
}
@ -1063,6 +1063,7 @@ static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) /
ZSTR_U(data->key) = BUCKET_KEY_U(b); \
} \
data->key_size = b->nKeyLength; \
data->h = b->h; \
} \
} while(0)
@ -1095,6 +1096,7 @@ static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) /
ZSTR_U(data->key) = BUCKET_KEY_U(b);
}
data->key_len = b->nKeyLength - 1;
data->h = b->h;
}
}
#endif
@ -1265,6 +1267,7 @@ int xc_is_shm(const void *p) /* {{{ */
}
/* }}} */
#ifdef ZEND_ENGINE_2
/* {{{ xc_gc_op_array_t */
typedef struct {
zend_uint num_args;
@ -1276,7 +1279,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) /* {{{ */
@ -1294,6 +1299,7 @@ static void xc_gc_op_array(void *pDest) /* {{{ */
}
}
/* }}} */
#endif
/* module helper function */
static int xc_init_constant(int module_number TSRMLS_DC) /* {{{ */
@ -1500,11 +1506,11 @@ static void xc_request_init(TSRMLS_D) /* {{{ */
zend_hash_destroy(&XG(internal_function_table));
zend_hash_destroy(&XG(internal_class_table));
zend_hash_init_ex(&XG(internal_function_table), 100, NULL, CG(function_table)->pDestructor, 1, 0);
zend_hash_init_ex(&XG(internal_class_table), 10, NULL, CG(class_table)->pDestructor, 1, 0);
zend_hash_init_ex(&XG(internal_function_table), 100, NULL, NULL, 1, 0);
zend_hash_init_ex(&XG(internal_class_table), 10, NULL, NULL, 1, 0);
zend_hash_copy(&XG(internal_function_table), CG(function_table), (copy_ctor_func_t) function_add_ref, &tmp_func, sizeof(tmp_func));
zend_hash_copy(&XG(internal_class_table), CG(class_table), (copy_ctor_func_t) xc_zend_class_add_ref, &tmp_cest, sizeof(tmp_cest));
zend_hash_copy(&XG(internal_function_table), CG(function_table), NULL, &tmp_func, sizeof(tmp_func));
zend_hash_copy(&XG(internal_class_table), CG(class_table), NULL, &tmp_cest, sizeof(tmp_cest));
XG(internal_table_copied) = 1;
}
@ -1522,7 +1528,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);
@ -1538,7 +1546,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);

10
xcache.h

@ -140,9 +140,15 @@ typedef char *zstr;
# define zend_u_hash_add(ht, type, arKey, nKeyLength, pData, nDataSize, pDest) \
zend_hash_add(ht, arKey, nKeyLength, pData, nDataSize, pDest)
# define zend_u_hash_quick_add(ht, type, arKey, nKeyLength, h, pData, nDataSize, pDest) \
zend_hash_quick_add(ht, arKey, nKeyLength, h, pData, nDataSize, pDest)
# define zend_u_hash_update(ht, type, arKey, nKeyLength, pData, nDataSize, pDest) \
zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest)
# define zend_u_hash_quick_update(ht, type, arKey, nKeyLength, h, pData, nDataSize, pDest) \
zend_hash_quick_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest)
# define zend_u_hash_find(ht, type, arKey, nKeyLength, pData) \
zend_hash_find(ht, arKey, nKeyLength, pData)
@ -222,6 +228,7 @@ typedef struct {
#endif
zstr key;
zend_uint key_size;
ulong h;
xc_cest_t cest;
int oplineno;
} xc_classinfo_t;
@ -234,6 +241,7 @@ typedef struct {
#endif
zstr key;
zend_uint key_size;
ulong h;
zend_constant constant;
} xc_constinfo_t;
/* }}} */
@ -245,6 +253,7 @@ typedef struct {
#endif
zstr key;
zend_uint key_size;
ulong h;
zend_function func;
} xc_funcinfo_t;
/* }}} */
@ -256,6 +265,7 @@ typedef struct {
#endif
zstr key;
zend_uint key_len;
ulong h;
} xc_autoglobal_t;
/* }}} */
#endif

2
xcache_globals.h

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

Loading…
Cancel
Save