Shouldn't C-ares have some environment variables (like curl has)
to control memory debugging and limits? I suggest something like
in ares_init.c / ares_init_options():
#ifdef CURLDEBUG
const char *env = getenv("CARES_MEMDEBUG");
if (env)
curl_memdebug(env);
env = getenv("CARES_MEMLIMIT");
if (env)
curl_memlimit(atoi(env));
#endif
Adding this and setting "CARES_MEMDEBUG=f:\temp\memdebug.cares",
reveals ahost.exe uses malloc/strdup heavily. My hosts file has "only"
8000 entries, but memanalyze.pl lists more than 48000 allocations and frees.
Could this be optimised somehow? Using mmap() or CreateFileMapping()
to parse the hosts file.
--gv
_______________________________________________
http://cool.haxx.se/mailman/listinfo/c-ares
Received on Sun May 15 13:03:38 2005