Mail Archives: djgpp-workers/2003/04/22/03:58:54
> Date: Mon, 21 Apr 2003 11:59:53 -0400
> From: CBFalconer <cbfalconer AT yahoo DOT com>
>
> Bit
> 0: Nothing. Even installing hooks is prevented
> 1: External hook installation allowed.
> 2: Malloc_verify enabled, messages only if anomalies
> 4: Automatic verify on all malloc/realloc calls, message only
> 8: Verify does immediate abort.
> 16: Reports free(NULL)
I don't think we should mix debug levels with the ability to install
hooks. These are two different features, so there shouldn't be any
dependencies. Can you tell why it would make sense to disallow hooks
in the first place? An application could weant to use them for
purposes utterly unrelated to debugging malloc.
> typedef enum (DBG_OFF = 0, DBG_HOOKS = 1, DBG_VERIFY = 2,
> DBG_AUTOVERIFY = 6, DBG_CATCH = 14,
> DBG_FREENULL = 16) DBGKIND;
>
> and free the code from dependance on arbitrary magic numbers.
I don't have access to a Unix box from where I type this: could
someone please look on Linux or SunOS/Solaris and see if they have
simple numbers, like 0, 1, 2, 3, etc. for malloc debug levels?
> DBGKIND malloc_debug(DBGKIND level);
This should be compatible to libmalloc.a on Unix systems, so again,
please someone look at man pages on such a system and tell what is
the prototype of malloc_debug, if there is any.
- Raw text -