Skip to content
Snippets Groups Projects
Commit 08cf758b authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

more debug

Rev: src/block_alloc.h:1.39
Rev: src/dmalloc.h:1.34
Rev: src/pike_macros.h:1.27
parent 5d62ddf0
Branches
Tags
No related merge requests found
/* $Id: block_alloc.h,v 1.38 2001/09/25 21:23:30 hubbe Exp $ */
/* $Id: block_alloc.h,v 1.39 2001/10/06 12:04:08 hubbe Exp $ */
#undef PRE_INIT_BLOCK
#undef INIT_BLOCK
#undef EXIT_BLOCK
......@@ -109,7 +109,7 @@ void PIKE_CONCAT3(really_free_,DATA,_unlocked)(struct DATA *d) \
{ \
EXIT_BLOCK(d); \
DO_IF_DMALLOC( PIKE_CONCAT(check_free_,DATA)(d); \
dmalloc_unregister(d, 1); ) \
dmalloc_mark_as_free(d, 1); ) \
d->BLOCK_ALLOC_NEXT = (void *)PIKE_CONCAT3(free_,DATA,s); \
PRE_INIT_BLOCK(d); \
PIKE_CONCAT3(free_,DATA,s)=d; \
......@@ -120,7 +120,7 @@ void PIKE_CONCAT(really_free_,DATA)(struct DATA *d) \
EXIT_BLOCK(d); \
DO_IF_RUN_UNLOCKED(mt_lock(&PIKE_CONCAT(DATA,_mutex))); \
DO_IF_DMALLOC( PIKE_CONCAT(check_free_,DATA)(d); \
dmalloc_unregister(d, 1); ) \
dmalloc_mark_as_free(d, 1); ) \
d->BLOCK_ALLOC_NEXT = (void *)PIKE_CONCAT3(free_,DATA,s); \
PRE_INIT_BLOCK(d); \
PIKE_CONCAT3(free_,DATA,s)=d; \
......
/*
* $Id: dmalloc.h,v 1.33 2001/10/03 22:21:32 nilsson Exp $
* $Id: dmalloc.h,v 1.34 2001/10/06 12:04:08 hubbe Exp $
*/
PMOD_EXPORT extern void *debug_xalloc(size_t);
......@@ -44,6 +44,7 @@ extern void dmalloc_free(void *p);
extern int debug_malloc_touch_fd(int, char *);
extern int debug_malloc_register_fd(int, char *);
extern int debug_malloc_close_fd(int, char *);
extern int dmalloc_mark_as_free(void*,int);
void *debug_malloc_update_location(void *, char *);
void *debug_malloc_update_location_ptr(void *, ptrdiff_t, char *);
......
......@@ -5,7 +5,7 @@
\*/
/*
* $Id: pike_macros.h,v 1.26 2001/07/22 21:36:14 mast Exp $
* $Id: pike_macros.h,v 1.27 2001/10/06 12:04:08 hubbe Exp $
*/
#ifndef MACROS_H
#define MACROS_H
......@@ -101,6 +101,7 @@
} while (0)
#define DOUBLELINK(first_object, o) do { \
debug_malloc_touch(o); \
o->next=first_object; \
o->prev=0; \
if(first_object) first_object->prev=o; \
......@@ -108,12 +109,15 @@
}while(0)
#define DOUBLEUNLINK(first_object,o) do{ \
debug_malloc_touch(o); \
if(o->prev) { \
o->prev->next=o->next; \
}else { \
DO_IF_DEBUG( \
if(first_object != o) \
if(first_object != o) { \
describe(o); \
fatal("Linked in wrong list!\n"); \
} \
) \
first_object=o->next; \
} \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment