[rfk-dev] CVS branch sneakums-nasty-hack

Paul J Collins sneakums@zork.net
10 Mar 2001 00:47:26 +0000


>>>>> "NM" == Nick Moffitt <nick@zork.net> writes:

    NM> So how come you used 0xdeadbeef as an invalid pointer value,
    NM> and not NULL?

It's not an invalid pointer value; I'm just using it to say "right now
I don't use this value, but I want to make sure that *you* are taking
good care of it anyway".  It's possible that some future backend will
want to have a structure with various bits of info in it, and so
that's what this pointer will point to.

Strictly speaking, it's not necessary.  It's just that I consider
file-level static variables almost as bad as globals.

    NM> I mean, isn't it at least *concievable* that the array could
    NM> be loaded at that location?  Most unixes load a bogus page at
    NM> address 0 to trap dereferencing of null pointers at the MMU
    NM> level.

I figure that NULL will be returned by nki_init if it can't, and so
using it as the placeholder value here would confuse matters.  It
could even be a bug!

-- 
"Pity has no place at my table."
      -- Dr Hannibal Lecter