debug code to check compiler result size
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@300 c26eb9a1-5813-0410-bd6c-c2e55f420ca71.2
parent
9b1666062e
commit
ddc1ca92f3
|
@ -38,6 +38,8 @@ m4_errprint(`AUTOCHECK INFO: runtime autocheck Enabled (debug build)')
|
|||
', `
|
||||
m4_errprint(`AUTOCHECK INFO: runtime autocheck Disabled (optimized build)')
|
||||
')
|
||||
ifdef(`DEBUG_SIZE', `static int xc_totalsize = 0;')
|
||||
|
||||
sinclude(builddir`/structinfo.m4')
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
divert(-1)
|
||||
dnl ================ start ======================
|
||||
dnl define(`XCACHE_ENABLE_TEST')
|
||||
dnl define(`DEBUG_SIZE')
|
||||
define(`USEMEMCPY')
|
||||
|
||||
dnl ================ main
|
||||
|
@ -49,6 +50,7 @@ define(`ALLOC', `
|
|||
}
|
||||
}
|
||||
}')
|
||||
void *oldp = processor->p;
|
||||
$1 = (FORCETYPE *) (processor->p = (char *) ALIGN(processor->p));
|
||||
ifelse(`$4', `', `
|
||||
IFASSERT(`memset($1, -1, SIZE);')
|
||||
|
@ -56,6 +58,11 @@ define(`ALLOC', `
|
|||
memset($1, 0, SIZE);
|
||||
')
|
||||
processor->p += SIZE;
|
||||
|
||||
ifdef(`DEBUG_SIZE', `
|
||||
xc_totalsize += (char *) processor->p - (char *) oldp;
|
||||
fprintf(stderr, "%d\t%d\t`'SIZE()\n", (char *) processor->p - (char *) oldp, xc_totalsize);
|
||||
')
|
||||
')
|
||||
IFRESTORE(`ifelse(`$4', `', `
|
||||
ifelse(
|
||||
|
|
Loading…
Reference in New Issue