On Mar 11, 2008, at 6:12 PM, Geoffrey Broadwell wrote:

I'm confused here.  My understanding of the difference between
PARROT_ASSERT and the PARROT_ASSERT_POINTER suggestion is that the
former checks for truth, and the other would check for lack of obvious
insanity.


A pointer of 0 is always, 100% of the time invalid.  Always.

A pointer of 0xdeadbeef has a non-zero chance of being valid and thus throwing a false positive. We don't get to control what malloc throws our way.

Although, I guess, we DO get to if we force all our allocations to go through mem_sys_allocate(), which we are indeed doing. Usually. I guess we COULD just make mem_sys_allocate() re-malloc if it gets the magic 0xdeadbeef. Hmmm.

xoa

--
Andy Lester => [EMAIL PROTECTED] => www.petdance.com => AIM:petdance




Reply via email to