Browse Source

tagged 3.0.0-rc1

git-svn-id: svn://svn.lighttpd.net/xcache/tags/3.0.0-rc1@1153 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.0.0-rc1
Xuefer 9 years ago
parent
commit
cb9565f5ae
  1. 14
      mod_cacher/xc_cacher.c
  2. 4
      mod_coverager/xc_coverager.c
  3. 12
      mod_optimizer/xc_optimizer.c
  4. 24
      xcache/xc_compatibility.h

14
mod_cacher/xc_cacher.c

@ -762,7 +762,7 @@ static zend_op_array *xc_entry_install(xc_entry_php_t *entry_php TSRMLS_DC) /* {
#ifndef ZEND_ENGINE_2
ALLOCA_FLAG(use_heap)
/* new ptr which is stored inside CG(class_table) */
xc_cest_t **new_cest_ptrs = (xc_cest_t **)my_do_alloca(sizeof(xc_cest_t*) * p->classinfo_cnt, use_heap);
xc_cest_t **new_cest_ptrs = (xc_cest_t **)xc_do_alloca(sizeof(xc_cest_t*) * p->classinfo_cnt, use_heap);
#endif
CG(active_op_array) = p->op_array;
@ -828,7 +828,7 @@ static zend_op_array *xc_entry_install(xc_entry_php_t *entry_php TSRMLS_DC) /* {
#endif
#ifndef ZEND_ENGINE_2
my_free_alloca(new_cest_ptrs, use_heap);
xc_free_alloca(new_cest_ptrs, use_heap);
#endif
CG(active_op_array) = old_active_op_array;
return p->op_array;
@ -949,7 +949,7 @@ static int xc_resolve_path(const char *filepath, char *path_buffer, xc_resolve_p
#endif
size = strlen(PG(include_path)) + 1;
paths = (char *)my_do_alloca(size, use_heap);
paths = (char *)xc_do_alloca(size, use_heap);
memcpy(paths, PG(include_path), size);
for (path = php_strtok_r(paths, tokens, &tokbuf); path; path = php_strtok_r(NULL, tokens, &tokbuf)) {
@ -984,7 +984,7 @@ static int xc_resolve_path(const char *filepath, char *path_buffer, xc_resolve_p
ret = FAILURE;
finish:
my_free_alloca(paths, use_heap);
xc_free_alloca(paths, use_heap);
return ret;
}
@ -2534,7 +2534,7 @@ static void xc_var_buffer_init(char *buffer, zval *name TSRMLS_DC) /* {{{ prepar
}
/* }}} */
typedef struct xc_namebuffer_t_ { /* {{{ */
ALLOCA_FLAG(useheap);
ALLOCA_FLAG(useheap)
void *buffer;
int alloca_size;
int len;
@ -2548,13 +2548,13 @@ typedef struct xc_namebuffer_t_ { /* {{{ */
name##_buffer.len = xc_var_buffer_prepare(name TSRMLS_CC); \
name##_buffer.alloca_size = xc_var_buffer_alloca_size(name TSRMLS_CC); \
name##_buffer.buffer = name##_buffer.alloca_size \
? do_alloca(name##_buffer.alloca_size, name##_buffer.useheap) \
? xc_do_alloca(name##_buffer.alloca_size, name##_buffer.useheap) \
: UNISW(Z_STRVAL_P(name), Z_TYPE(name) == IS_UNICODE ? Z_USTRVAL_P(name) : Z_STRVAL_P(name)); \
if (name##_buffer.alloca_size) xc_var_buffer_init(name##_buffer.buffer, name TSRMLS_CC);
#define VAR_BUFFER_FREE(name) \
if (name##_buffer.alloca_size) { \
free_alloca(name##_buffer.buffer, name##_buffer.useheap); \
xc_free_alloca(name##_buffer.buffer, name##_buffer.useheap); \
}
static inline int xc_var_has_prefix(xc_entry_t *entry, zval *prefix TSRMLS_DC) /* {{{ */

4
mod_coverager/xc_coverager.c

@ -46,7 +46,7 @@ static void xcache_mkdirs_ex(char *root, int rootlen, char *path, int pathlen TS
ALLOCA_FLAG(use_heap)
TRACE("mkdirs %s %d %s %d", root, rootlen, path, pathlen);
fullpath = my_do_alloca(rootlen + pathlen + 1, use_heap);
fullpath = xc_do_alloca(rootlen + pathlen + 1, use_heap);
memcpy(fullpath, root, rootlen);
memcpy(fullpath + rootlen, path, pathlen);
fullpath[rootlen + pathlen] = '\0';
@ -67,7 +67,7 @@ static void xcache_mkdirs_ex(char *root, int rootlen, char *path, int pathlen TS
mkdir(fullpath, 0700);
#endif
}
my_free_alloca(fullpath, use_heap);
xc_free_alloca(fullpath, use_heap);
}
/* }}} */
static void xc_coverager_save_cov(char *srcfile, char *outfilename, coverager_t cov TSRMLS_DC) /* {{{ */

12
mod_optimizer/xc_optimizer.c

@ -391,11 +391,11 @@ static int bbs_build_from(bbs_t *bbs, zend_op_array *op_array, int count) /* {{{
ALLOCA_FLAG(use_heap_bbids)
ALLOCA_FLAG(use_heap_catchbbids)
ALLOCA_FLAG(use_heap_markbbhead)
bbid_t *bbids = my_do_alloca(count * sizeof(bbid_t), use_heap_bbids);
bbid_t *bbids = xc_do_alloca(count * sizeof(bbid_t), use_heap_bbids);
#ifdef ZEND_ENGINE_2
bbid_t *catchbbids = my_do_alloca(count * sizeof(bbid_t), use_heap_catchbbids);
bbid_t *catchbbids = xc_do_alloca(count * sizeof(bbid_t), use_heap_catchbbids);
#endif
zend_bool *markbbhead = my_do_alloca(count * sizeof(zend_bool), use_heap_markbbhead);
zend_bool *markbbhead = xc_do_alloca(count * sizeof(zend_bool), use_heap_markbbhead);
/* {{{ mark jmpin/jumpout */
memset(markbbhead, 0, count * sizeof(zend_bool));
@ -502,11 +502,11 @@ static int bbs_build_from(bbs_t *bbs, zend_op_array *op_array, int count) /* {{{
}
/* }}} */
my_free_alloca(markbbhead, use_heap_markbbhead);
xc_free_alloca(markbbhead, use_heap_markbbhead);
#ifdef ZEND_ENGINE_2
my_free_alloca(catchbbids, use_heap_catchbbids);
xc_free_alloca(catchbbids, use_heap_catchbbids);
#endif
my_free_alloca(bbids, use_heap_bbids);
xc_free_alloca(bbids, use_heap_bbids);
return SUCCESS;
}
/* }}} */

24
xcache/xc_compatibility.h

@ -37,14 +37,14 @@
#endif
#ifdef do_alloca_with_limit
# define my_do_alloca(size, use_heap) do_alloca_with_limit(size, use_heap)
# define my_free_alloca(size, use_heap) free_alloca_with_limit(size, use_heap)
# define xc_do_alloca(size, use_heap) do_alloca_with_limit(size, use_heap)
# define xc_free_alloca(size, use_heap) free_alloca_with_limit(size, use_heap)
#elif defined(ALLOCA_FLAG)
# define my_do_alloca(size, use_heap) do_alloca(size, use_heap)
# define my_free_alloca(size, use_heap) free_alloca(size, use_heap)
# define xc_do_alloca(size, use_heap) do_alloca(size, use_heap)
# define xc_free_alloca(size, use_heap) free_alloca(size, use_heap)
#else
# define my_do_alloca(size, use_heap) do_alloca(size)
# define my_free_alloca(size, use_heap) free_alloca(size)
# define xc_do_alloca(size, use_heap) do_alloca(size)
# define xc_free_alloca(size, use_heap) free_alloca(size)
# define ALLOCA_FLAG(x)
#endif
#ifndef Z_ISREF
@ -67,28 +67,28 @@
#endif
/* {{{ dirty fix for PHP 6 */
#ifdef add_assoc_long_ex
static inline void my_add_assoc_long_ex(zval *arg, char *key, uint key_len, long value)
static inline void xc_add_assoc_long_ex(zval *arg, char *key, uint key_len, long value)
{
add_assoc_long_ex(arg, key, key_len, value);
}
# undef add_assoc_long_ex
# define add_assoc_long_ex my_add_assoc_long_ex
# define add_assoc_long_ex xc_add_assoc_long_ex
#endif
#ifdef add_assoc_bool_ex
static inline void my_add_assoc_bool_ex(zval *arg, char *key, uint key_len, zend_bool value)
static inline void xc_add_assoc_bool_ex(zval *arg, char *key, uint key_len, zend_bool value)
{
add_assoc_bool_ex(arg, key, key_len, value);
}
# undef add_assoc_bool_ex
# define add_assoc_bool_ex my_add_assoc_bool_ex
# define add_assoc_bool_ex xc_add_assoc_bool_ex
#endif
#ifdef add_assoc_null_ex
static inline void my_add_assoc_null_ex(zval *arg, char *key, uint key_len)
static inline void xc_add_assoc_null_ex(zval *arg, char *key, uint key_len)
{
add_assoc_null_ex(arg, key, key_len);
}
# undef add_assoc_null_ex
# define add_assoc_null_ex my_add_assoc_null_ex
# define add_assoc_null_ex xc_add_assoc_null_ex
#endif
/* }}} */

Loading…
Cancel
Save