Browse Source

renamed DEBUG to XCACHE_DEBUG due to conflict to ext/date

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@543 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.0
Xuefer 14 years ago
parent
commit
2a1d287e53
  1. 8
      coverager.c
  2. 13
      mem.c
  3. 18
      optimizer.c
  4. 6
      utils.h
  5. 4
      xcache.c

8
coverager.c

@ -1,3 +1,7 @@
#if 0
#define XCACHE_DEBUG
#endif
#include <stdio.h>
#include "xcache.h"
#include "ext/standard/flock_compat.h"
@ -18,10 +22,6 @@ typedef HashTable *coverager_t;
static char *xc_coveragedump_dir = NULL;
static zend_compile_file_t *old_compile_file = NULL;
#if 0
#define DEBUG
#endif
/* dumper */
static void xc_destroy_coverage(void *pDest) /* {{{ */
{

13
mem.c

@ -1,10 +1,16 @@
#ifdef TEST
#include <limits.h>
#include <stdio.h>
# define XCACHE_DEBUG
#else
#include <php.h>
#endif
#ifdef XCACHE_DEBUG
# define ALLOC_DEBUG_BLOCK_CHECK
#endif
#include <assert.h>
#include <stdlib.h>
#include <string.h>
@ -14,13 +20,6 @@
#include "align.h"
#include "utils.h"
#ifdef TEST
# define DEBUG
#endif
#ifdef DEBUG
# define ALLOC_DEBUG_BLOCK_CHECK
#endif
#if 0
#undef ALLOC_DEBUG_BLOCK_CHECK
#endif

18
optimizer.c

@ -1,5 +1,5 @@
#if 0
# define DEBUG
# define XCACHE_DEBUG
#endif
#include "utils.h"
@ -8,7 +8,7 @@
#include "stack.h"
#include "xcache_globals.h"
#ifdef DEBUG
#ifdef XCACHE_DEBUG
# include "processor.h"
# include "const_string.h"
# include "ext/standard/php_var.h"
@ -180,7 +180,7 @@ static int op_get_flowinfo(op_flowinfo_t *fi, zend_op *opline) /* {{{ */
return SUCCESS;
}
/* }}} */
#ifdef DEBUG
#ifdef XCACHE_DEBUG
static void op_snprint(char *buf, int size, znode *op) /* {{{ */
{
switch (op->op_type) {
@ -277,7 +277,7 @@ static void bb_destroy(bb_t *bb) /* {{{ */
efree(bb);
}
/* }}} */
#ifdef DEBUG
#ifdef XCACHE_DEBUG
static void bb_print(bb_t *bb, zend_op *opcodes) /* {{{ */
{
int line = bb->opcodes - opcodes;
@ -319,7 +319,7 @@ static void bbs_destroy(bbs_t *bbs) /* {{{ */
xc_stack_destroy(bbs);
}
/* }}} */
#ifdef DEBUG
#ifdef XCACHE_DEBUG
static void bbs_print(bbs_t *bbs, zend_op *opcodes) /* {{{ */
{
int i;
@ -407,7 +407,7 @@ static int bbs_build_from(bbs_t *bbs, zend_op_array *op_array, int count) /* {{{
catchbbids[j] = bbids[e->catch_op];
}
}
#ifdef DEBUG
#ifdef XCACHE_DEBUG
for (i = 0; i < count; i ++) {
TRACE("catchbbids[%d] = %d", i, catchbbids[i]);
}
@ -521,7 +521,7 @@ static int xc_optimize_op_array(zend_op_array *op_array TSRMLS_DC) /* {{{ */
return 0;
}
#ifdef DEBUG
#ifdef XCACHE_DEBUG
# if 0
TRACE("optimize file: %s", op_array->filename);
xc_dprint_zend_op_array(op_array, 0 TSRMLS_CC);
@ -533,7 +533,7 @@ static int xc_optimize_op_array(zend_op_array *op_array TSRMLS_DC) /* {{{ */
bbs_init(&bbs);
if (bbs_build_from(&bbs, op_array, op_array->last) == SUCCESS) {
int i;
#ifdef DEBUG
#ifdef XCACHE_DEBUG
bbs_print(&bbs, op_array->opcodes);
#endif
/* TODO: calc opnum after basic block move */
@ -546,7 +546,7 @@ static int xc_optimize_op_array(zend_op_array *op_array TSRMLS_DC) /* {{{ */
bbs_destroy(&bbs);
}
#ifdef DEBUG
#ifdef XCACHE_DEBUG
# if 0
TRACE("%s", "after compiles");
xc_dprint_zend_op_array(op_array, 0 TSRMLS_CC);

6
utils.h

@ -1,7 +1,7 @@
#include "php.h"
#include "xcache.h"
#ifdef DEBUG
#ifdef XCACHE_DEBUG
# define IFDEBUG(x) (x)
int xc_vtrace(const char *fmt, va_list args);
int xc_trace(const char *fmt, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
@ -24,7 +24,7 @@ static inline int TRACE(const char *fmt, ...)
# undef NDEBUG
# undef inline
# define inline
#else /* DEBUG */
#else /* XCACHE_DEBUG */
# ifdef ZEND_WIN32
static inline int TRACE_DUMMY(const char *fmt, ...)
@ -40,7 +40,7 @@ static inline int TRACE_DUMMY(const char *fmt, ...)
# ifndef NDEBUG
# define NDEBUG
# endif
#endif /* DEBUG */
#endif /* XCACHE_DEBUG */
#include <assert.h>
typedef struct {

4
xcache.c

@ -1,6 +1,6 @@
#if 0
#define DEBUG
#define XCACHE_DEBUG
#endif
#if 0
@ -1028,7 +1028,7 @@ static int xc_entry_init_key_php_md5(xc_entry_data_php_t *php, xc_entry_t *xce T
hv = xc_php_hash_md5(php TSRMLS_CC);
php->cache = xce->cache;
php->hvalue = (hv & php->cache->hphp->mask);
#ifdef DEBUG
#ifdef XCACHE_DEBUG
{
char md5str[33];
make_digest(md5str, (unsigned char *) php->md5);

Loading…
Cancel
Save