Mail Archives: djgpp-workers/2003/03/23/14:23:42
> Date: Sat, 22 Mar 2003 23:54:11 -0500
> From: CBFalconer <cbfalconer AT yahoo DOT com>
> 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 <cbfalconer AT yahoo DOT com>
> > >
> > > > > 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).
- Raw text -