gluster-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gluster-devel] strange code in mem-pool.h


From: Raghavendra G
Subject: Re: [Gluster-devel] strange code in mem-pool.h
Date: Wed, 14 Jan 2009 22:27:53 +0400

Hi Corin,

On Wed, Jan 14, 2009 at 6:53 PM, Corin Langosch <address@hidden> wrote:
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
address@hidden
http://lists.nongnu.org/mailman/listinfo/gluster-devel



--
Raghavendra G


reply via email to

[Prev in Thread] Current Thread [Next in Thread]