At 09:57 AM 9/12/2001 -0700, Hong Zhang wrote:
> > Now works on Solaris and i386, but segfaults at the GRAB_IV call in
> > read_constants_table on my Alpha. Problems with the integer-pointer
> > conversions in memory.c? (line 29 is giving me a warning).
>
>The line 29 is extremely wrong. It assigns IV to void* without casting.
True. I'll go fix it.
>The alignment calculation is very wrong too. Using classic alignment,
>it should read as:
>
> mem = (void*) (((IV)mem + mask) & ~mask);
Nope. We're trying to align to a power-of-two boundary, and mask is set to
chop off the low bits, not the high ones. It should be something like:
111111110000
The calc:
mem & mask + (~mask + 1)
will chop the low bits off of mem, making it too small, but power-of-two
aligned. Then we add in the inverse of mask + 1 (in the above example,
that'd be 10000) to jump it to the next power-of-two boundary.
Horribly wasteful of memory, definitely, and the final allocation system
will do things better, but this is OK to start.
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk