On Thursday 10 July 2008 13:42:07 Andrew Whitworth wrote:
> I found this while tracking a nasty GC-related bug. In
> src/packfile/pf_items.c:PF_fetch_integer, we have the following two
> notes:
>
> XXX assumes C<sizeof (INTVAL) == sizeof (opcode_t) - we don't have
> INTVAL size in the PackFile header
>
> XXX assume sizeof (opcode_t) == sizeof (INTVAL) on the machine
> producing this PBC
>
> This raises the question, are the two always defined to be the same
> (which makes this a non-issue), or are there platforms where they are
> different? I suspect a fix would not be too too difficult if they
> aren't always the same, and if the behavior wasn't already implemented
> elsewhere.
They're defined in parrot/config.h, which gets built from
config/gen/config_h/config_h.in:
------> typedef @iv@ Parrot_Int;
typedef unsigned @iv@ Parrot_UInt;
typedef @nv@ Parrot_Float;
------> typedef @opcode_t@ Parrot_Opcode;
The defaults are in config/inter/types.pm, and both default to 'long'.
However, in prompting mode, the user can set both to different sizes. That's
probably a mistake. If we prevented them from differing, we could remove
these comments.
-- c