axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frederic Heem <>
Subject valgrind and memory leaks
Date Tue, 20 May 2008 17:17:51 GMT
Hi folks,
Valgrind 3.3 is being mainly used to track memory leak, unfortunately, 
it doesn't catch memory allocated by the macro AXIS2_MALLOC, probably 
due to the fact that it uses a function pointer. Modifying the three 
macro as follows solves this problem and memory leaks can be finally 
detected during development.

#if 0
#define AXIS2_MALLOC(allocator, size) \
      ((allocator)->malloc_fn(allocator, size))

#define AXIS2_REALLOC(allocator, ptr, size) \
      ((allocator)->realloc(allocator, ptr, size))

#define AXIS2_FREE(allocator, ptr) \
      ((allocator)->free_fn(allocator, ptr))
#include <stdlib.h>
#define AXIS2_MALLOC(allocator, size) \

#define AXIS2_REALLOC(allocator, ptr, size) \
      realloc(ptr, size)

#define AXIS2_FREE(allocator, ptr) \

Best Regards,
Frederic Heem


--- NOTICE ---

This  email  and  any  attachments  are  confidential and are intended for the
addressee  only.  If you have received this message by mistake, please contact
us  immediately and  then  delete the message from your system.   You must not
copy, distribute, disclose  or  act upon the contents of this email.  Personal
and corporate data submitted will be used in a correct, transparent and lawful
manner. The data collected will be processed in paper or computerized form for
the  performance  of  contractual  and  lawful  obligations as well as for the
effective  management of business relationship.   The data processor is Telsey
S.p.A.   The  data  subject may exercise all the rights set forth in art. 7 of
Law  by  Decree  30.06.2003  n.  196   as   reported   in  the  following  url


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message