On Wed, Jan 14, 2009 at 6:53 PM, Corin Langosch <corinl@xxxxxx> wrote:
Because the probability of NULL being a valid value of pointer is more than 0xeeeeeeee being the value of pointer. By observing the value of pointer to be 0xeeeeeeeee we can judge it to be FREEd during debugging process.
regards,
Hi all,
while working on my second patch I wonder about this peace of code in
mem-pool.h:
#define FREE(ptr) \
if (ptr != NULL) { \
free ((void *)ptr); \
ptr = (void *)0xeeeeeeee; \
}
Why is the pointer not set to NULL?
Because the probability of NULL being a valid value of pointer is more than 0xeeeeeeee being the value of pointer. By observing the value of pointer to be 0xeeeeeeeee we can judge it to be FREEd during debugging process.
regards,
Corin
_______________________________________________
Gluster-devel mailing list
Gluster-devel@xxxxxxxxxx
http://lists.nongnu.org/mailman/listinfo/gluster-devel
--
Raghavendra G