Hi Corin,<br><br><div class="gmail_quote">On Wed, Jan 14, 2009 at 6:53 PM, Corin Langosch <span dir="ltr">&lt;<a href="mailto:corinl@gmx.de">corinl@gmx.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all,<br>
<br>
while working on my second patch I wonder about this peace of code in<br>
mem-pool.h:<br>
<br>
#define FREE(ptr) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\<br>
 &nbsp; &nbsp;if (ptr != NULL) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\<br>
 &nbsp; &nbsp; &nbsp; &nbsp;free ((void *)ptr); &nbsp; &nbsp; &nbsp; &nbsp;\<br>
 &nbsp; &nbsp; &nbsp; &nbsp;ptr = (void *)0xeeeeeeee; &nbsp; &nbsp;\<br>
 &nbsp; &nbsp;}<br>
<br>
Why is the pointer not set to NULL?</blockquote><div><br>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.<br>
<br>regards,<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
Corin<br>
<br>
<br>
_______________________________________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@nongnu.org">Gluster-devel@nongnu.org</a><br>
<a href="http://lists.nongnu.org/mailman/listinfo/gluster-devel" target="_blank">http://lists.nongnu.org/mailman/listinfo/gluster-devel</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Raghavendra G<br><br>