This is the mail archive of the
newlib@sourceware.cygnus.com
mailing list for the newlib project.
Re: user defined malloc
- To: "J. Johnston" <jjohnstn at cygnus dot com>
- Subject: Re: user defined malloc
- From: "Ashif S. Harji" <asharji at plg2 dot math dot uwaterloo dot ca>
- Date: Tue, 4 Jul 2000 16:49:00 -0400 (EDT)
- cc: newlib at sourceware dot cygnus dot com
On Tue, 4 Jul 2000, J. Johnston wrote:
> > Basically, I am trying to find out if it is possible to provide my own
> > version of malloc? If so, does this also require _malloc_r to be
> > overriden (see message below?. And finally, if someone can provide some
> > information or a link on what is required to override _malloc_r (if it is
> > necessary).
> >
>
> The _malloc_r routine is indeed a version of malloc which uses an additional
> parameter to receive a reentrancy structure. The malloc routine simply calls _malloc_r with
> the default reentrancy structure. Internally, any reentrant library routines must
> call _malloc_r instead of malloc and pass whichever reentrancy structure was
> passed to them. Thus, you want to replace the _r interfaces rather than the
> top level routines like malloc() and free().
>
Thank you for the info. Presently it is not possible to override the
_r interfaces, e.g. _malloc_r, with cygwin. I will pass along your
message and request this change. Just for clarification, should I ask
them to allow both the top level routines and the _r interfaces to be
replaceable, or just the _r interfaces?