From 0af13b375cfb7b435db70701f1191d5160bce604 Mon Sep 17 00:00:00 2001 From: Xuefer Date: Wed, 18 Jul 2012 07:01:59 +0000 Subject: [PATCH] split trace git-svn-id: svn://svn.lighttpd.net/xcache/trunk@990 c26eb9a1-5813-0410-bd6c-c2e55f420ca7 --- config.m4 | 1 + config.w32 | 1 + util/xc_stack.c | 3 ++- util/xc_trace.c | 21 +++++++++++++++++++++ xcache/xc_sandbox.c | 17 ----------------- xcache/xc_utils.c | 3 +-- xcache/xc_utils.h | 2 -- 7 files changed, 26 insertions(+), 22 deletions(-) create mode 100644 util/xc_trace.c diff --git a/config.m4 b/config.m4 index 1060ed5..7523c79 100644 --- a/config.m4 +++ b/config.m4 @@ -25,6 +25,7 @@ if test "$PHP_XCACHE" != "no"; then xcache_sources=" util/xc_stack.c \ + util/xc_trace.c \ xcache.c \ xcache/xc_const_string.c \ xcache/xc_lock.c \ diff --git a/config.w32 b/config.w32 index a3ed91a..abbeb3d 100644 --- a/config.w32 +++ b/config.w32 @@ -13,6 +13,7 @@ if (PHP_XCACHE != "no") { var xcache_sources = " util/xc_stack.c \ + util/xc_trace.c \ xcache.c \ xcache/xc_const_string.c \ xcache/xc_lock.c \ diff --git a/util/xc_stack.c b/util/xc_stack.c index 244339c..7407583 100644 --- a/util/xc_stack.c +++ b/util/xc_stack.c @@ -1,6 +1,7 @@ #include -#include +#include "xc_trace.h" #include "xc_stack.h" + typedef xc_stack_t* S; void xc_stack_init_ex(S stack, int initsize) diff --git a/util/xc_trace.c b/util/xc_trace.c new file mode 100644 index 0000000..09105d2 --- /dev/null +++ b/util/xc_trace.c @@ -0,0 +1,21 @@ +#include "xc_trace.h" +#include +#include + +int xc_vtrace(const char *fmt, va_list args) /* {{{ */ +{ + return vfprintf(stderr, fmt, args); +} +/* }}} */ +int xc_trace(const char *fmt, ...) /* {{{ */ +{ + va_list args; + int ret; + + va_start(args, fmt); + ret = xc_vtrace(fmt, args); + va_end(args); + return ret; +} +/* }}} */ + diff --git a/xcache/xc_sandbox.c b/xcache/xc_sandbox.c index 42fd88f..b8339fb 100644 --- a/xcache/xc_sandbox.c +++ b/xcache/xc_sandbox.c @@ -433,23 +433,6 @@ zend_uint xc_sandbox_compilererror_cnt(TSRMLS_D) /* {{{ */ /* }}} */ #endif -int xc_vtrace(const char *fmt, va_list args) /* {{{ */ -{ - return vfprintf(stderr, fmt, args); -} -/* }}} */ -int xc_trace(const char *fmt, ...) /* {{{ */ -{ - va_list args; - int ret; - - va_start(args, fmt); - ret = xc_vtrace(fmt, args); - va_end(args); - return ret; -} -/* }}} */ - #ifndef ZEND_ENGINE_2_3 #include "ext/standard/php_string.h" size_t xc_dirname(char *path, size_t len) /* {{{ */ diff --git a/xcache/xc_utils.c b/xcache/xc_utils.c index 48c53df..5f750db 100644 --- a/xcache/xc_utils.c +++ b/xcache/xc_utils.c @@ -6,8 +6,7 @@ #include "zend_vm.h" #endif #include "xc_opcode_spec.h" -#undef NDEBUG -#include "assert.h" +#include "../util/xc_trace.h" #ifndef max #define max(a, b) ((a) < (b) ? (b) : (a)) diff --git a/xcache/xc_utils.h b/xcache/xc_utils.h index f82a03f..1e45029 100644 --- a/xcache/xc_utils.h +++ b/xcache/xc_utils.h @@ -40,8 +40,6 @@ ZESW(xc_cest_t *, void) xc_install_class(ZEND_24(NOTHING, const) char *filename, #define XCACHE_ERROR_CACHING #endif -void xc_zend_class_add_ref(zend_class_entry ZESW(*ce, **ce)); - typedef zend_bool (*xc_if_func_t)(void *data); void xc_hash_copy_if(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, xc_if_func_t checker);