cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: malloc/free.. callback functions

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Sun, 4 Apr 2004 12:47:04 -0700

On Sun, Apr 04, 2004 at 08:22:27PM +0200, Tor Arntsen wrote:
> On Apr 4, 10:59, Seshubabu Pasam wrote:
> >Hmmm! Not exactly sure, how your suggestion would work! efence from what
> >know, does mmap to allocate/manage memory. So it completely replaces
> >malloc/free/realloc implementations ... In our case we are not
> >completely replacing malloc/free/realloc etc. We are just wrapping them
> >in our own functions and doing some checks for bad stuff.
> [...]
>
> Ah, yes if what you want is to both do your own thing *and* use
> the libc malloc etc. as well, then simply replacing the system
> calls isn't enough. In that case I'm actually for your original
> suggestion.

Some systems already give you hooks to the malloc routines that might be
good enough for what you want. See __malloc_hook under glibc, for example.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2004-04-04