curl-library
Re: malloc/free.. callback functions
Date: Sun, 04 Apr 2004 17:21:12 -0700
> It couldn't be made with CURLOPT-options, since we've made numerous malloc()s
> already by the time you'll get the first opportunity to use it.
Yes. As I mentioned in my previous mail, I used this as an example. The
appropriate way is to use some function like: curl_set_memory_callbacks
(see my previous mail for details.)
> But... if you're doing this to track or trace memory problems, won't you then
> also be interested in hooks for other resource-using system functions libcurl
> uses? Like fopen(), socket() etc? You couldn't do a fair leak detection
> withotut them...
That is true. May be we go can beyond just the memory stuff.
> (I'm not totally against this suggestion, I just need to bounce around
> thoughts and arguments before I decide anything.)
I understand. This is not something I invented. I am just throwing
something, I came across in numerous other libraries (libxml2, PCRE ...)
This is not only useful for checking leaks etc, it may also be used to
find in-appropriate use of curl library.
-Seshubabu Pasam
Received on 2004-04-05