Hello, all!

how slowly will work test mode of project, if all memory allocation functions, 
such
as malloc, realloc, calloc change to function with pointer registration in
the pointer list ?

#define NETSNMP_PL_TEST_MODE // something like this
#ifdef NETSNMP_PL_TEST_MODE
#define malloc snmp_pl_malloc
#define realloc snmp_pl_realloc
#define calloc snmp_pl_calloc
#define free   snmp_pl_free
#endif
snmp_pl_xxalloc(..., int __LINE__, char *__FILE__)
{
   ...
   add pointer in the pointer list by pointer value
   ...
}

snmp_pl_free(..., int __LINE__, char *__FILE__)
{
   ...
   remove pointer from the pointer list by pointer value
   ...
}

When program finishes the work, simply print list of left pointers,
to find memory leaks...

Aleksandr Lomanov
ICQ#: 170411676


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to