Date: Tue, 22 Apr 2003 10:53:30 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: djgpp-workers AT delorie DOT com Message-Id: <4098-Tue22Apr2003105330+0300-eliz@elta.co.il> X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9 In-reply-to: <3EA41578.9E69308C@yahoo.com> (message from CBFalconer on Mon, 21 Apr 2003 11:59:53 -0400) Subject: Re: nmalloc revisited References: <10304211406 DOT AA25239 AT clio DOT rice DOT edu> <3EA41578 DOT 9E69308C AT yahoo DOT com> Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Date: Mon, 21 Apr 2003 11:59:53 -0400 > From: CBFalconer > > 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.