Date: Sun, 23 Mar 2003 21:16:54 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: djgpp-workers AT delorie DOT com Message-Id: <1190-Sun23Mar2003211653+0200-eliz@elta.co.il> X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9 In-reply-to: <3E7D3DF3.3CBF1838@yahoo.com> (message from CBFalconer on Sat, 22 Mar 2003 23:54:11 -0500) Subject: Re: nmalloc revisited References: <10303181605 DOT AA14400 AT clio DOT rice DOT edu> <3E775688 DOT AC55F82B AT yahoo DOT com> <3E77E453 DOT A12179D3 AT yahoo DOT com> <9743-Wed19Mar2003183156+0200-eliz AT elta DOT co DOT il> <3E78B4BF DOT A8778A96 AT yahoo DOT com> <9003-Wed19Mar2003225200+0200-eliz AT elta DOT co DOT il> <3E790C18 DOT CFBB8117 AT yahoo DOT com> <7704-Sun23Mar2003060449+0200-eliz AT elta DOT co DOT il> <3E7D3DF3 DOT 3CBF1838 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: Sat, 22 Mar 2003 23:54:11 -0500 > From: CBFalconer > Organization: Ched Research > X-Accept-Language: en > X-Mailing-List: djgpp-workers AT delorie DOT com > X-Unsubscribes-To: listserv AT delorie DOT com > X-PRIVAWALL-ID: 0002556710ac > X-OriginalArrivalTime: 23 Mar 2003 04:58:27.0187 (UTC) FILETIME=[D724E430:01C2F0F8] > > Eli Zaretskii wrote: > > > From: CBFalconer > > > > > > > > what about: > > > > > > > > > > int malloc_debug(int level, FILE *f); > > > > > > > > > > where f == NULL is the present call, and something else sets the > > > > > output file. Maybe we rename it _malloc_dbg and provide a macro: > > > > > > > > > > #define malloc_debug(i) _malloc_dbg(i, NULL) > > > > > ... snip ... > > > > Perhaps just have > > > > int malloc_debug(int level); > > > > and > > > > int _malloc_debug_with_file(int level, FILE *f); > > What's the difference from the above macro definition except the > name of the system function? I generally don't like having macros instead of functions in the library. Macros get in the way in some situations, like if you want to take an address of a function. I think we should limit the use of macros in the library's external API to those cases where there's some standard or some other common practice that mandate a macro. But that's me. Otherwise, the two possibilities are functionally equivalent, I think (I don't care much about what name we choose, as long as malloc_debug is exported).