1
0
Fork 0

fill uninitialized with line number for debugging purpose

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@836 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
This commit is contained in:
Xuefer 2012-03-25 01:59:20 +00:00
parent 26270cb455
commit adff8d2eab
2 changed files with 26 additions and 3 deletions

View File

@ -30,6 +30,10 @@ define(`SIZEOF_zval_ptr', `sizeof(zval_ptr)')
define(`COUNTOF_zval_ptr', `1')
define(`SIZEOF_zval_ptr_nullable', `sizeof(zval_ptr_nullable)')
define(`COUNTOF_zval_ptr_nullable', `1')
define(`SIZEOF_zend_trait_alias_ptr', `sizeof(zend_trait_alias)')
define(`COUNTOF_zend_trait_alias_ptr', `1')
define(`SIZEOF_zend_trait_precedence_ptr', `sizeof(zend_trait_precedence)')
define(`COUNTOF_zend_trait_precedence_ptr', `1')
define(`SIZEOF_xc_entry_name_t', `sizeof(xc_entry_name_t)')
define(`COUNTOF_xc_entry_name_t', `1')
@ -51,6 +55,11 @@ sinclude(builddir`/structinfo.m4')
typedef zval *zval_ptr;
typedef zval *zval_ptr_nullable;
#ifdef ZEND_ENGINE_2_4
typedef zend_trait_alias *zend_trait_alias_ptr;
typedef zend_trait_precedence *zend_trait_precedence_ptr;
#endif
typedef zend_uchar zval_data_type;
#ifdef IS_UNICODE
typedef UChar zstr_uchar;
@ -91,6 +100,20 @@ struct _xc_processor_t {
IFASSERT(xc_stack_t allocsizes;)
};
/* }}} */
/* {{{ memsetptr */
IFASSERT(`dnl
static void *memsetptr(void *mem, void *content, size_t n)
{
void **p = (void **) mem;
void **end = (char *) mem + n;
while (p < end) {
*p = content;
p += sizeof(content);
}
return mem;
}
')
/* }}} */
#ifdef HAVE_XCACHE_DPRINT
static void xc_dprint_indent(int indent) /* {{{ */
{
@ -314,7 +337,7 @@ static void xc_zend_extension_op_array_ctor_handler(zend_extension *extension, z
/* }}} */
/* {{{ field name checker */
IFASSERT(`dnl
int xc_check_names(const char *file, int line, const char *functionName, const char **assert_names, int assert_names_count, HashTable *done_names)
static int xc_check_names(const char *file, int line, const char *functionName, const char **assert_names, int assert_names_count, HashTable *done_names)
{
int errors = 0;
if (assert_names_count) {

View File

@ -55,7 +55,7 @@ define(`ALLOC', `
')
$1 = (FORCETYPE *) (processor->p = (char *) ALIGN(processor->p));
ifelse(`$4', `', `
IFASSERT(`memset($1, -1, SIZE);')
IFASSERT(`memsetptr($1, (void *) __LINE__, SIZE);')
', `
memset($1, 0, SIZE);
')
@ -72,7 +72,7 @@ define(`ALLOC', `
FORCETYPE*COUNT, `zval*1', `ALLOC_ZVAL($1);',
FORCETYPE*COUNT, `HashTable*1', `ALLOC_HASHTABLE($1);',
`', `', `$1 = (FORCETYPE *) emalloc(SIZE);')
IFASSERT(`memset($1, -1, SIZE);')
IFASSERT(`memsetptr($1, (void *) __LINE__, SIZE);')
', `
$1 = (FORCETYPE *) ecalloc(COUNT, sizeof($2));
')