Reduce random casting in looks_like_valid_lisp_pointer_p().
authorAlastair Bridgewater <nyef@kana.lisphacker.com>
Wed, 23 Nov 2011 15:55:51 +0000 (10:55 -0500)
committerAlastair Bridgewater <nyef@kana.lisphacker.com>
Wed, 23 Nov 2011 15:55:51 +0000 (10:55 -0500)
commitaecefb5d1dfdab6b004796c8b0b48fd2ab6643df
treee9ed369c51ed36254025be056ba767e91d415ca1
parentf7a78dd3554bd977b006e5da349a11d4e8463bb5
Reduce random casting in looks_like_valid_lisp_pointer_p().

  * The casts are ugly, and obscure the logic.

  * The casts are WRONG on systems with 64-bit pointers and 32-bit
long integers (thanks to akovalenko for pointing this out).

  * We already have utility functions to do most-to-all of what
we're doing with casts.

  * And we never use one of our (lispobj *) parameters as an actual
pointer, we always cast it all over the place instead.

  * So, take a lispobj instead of a (lispobj *), and use utility
functions from runtime.h instead of inline casting and random
pointer arithmetic.
src/runtime/gc-common.c
src/runtime/gc-internal.h