Andy Dougherty wrote:
On Tue, 4 Oct 2005, Leopold Toetsch via RT wrote:
Anyway, does:
p = (struct Parrot_Context *) ( (char *) p + ALIGNED_CTX_SIZE );
help, or better is it "more correct"?
While this does indeed replace the warning by a different warning ("cast
increases required alignment of target type"), it doesn't fix the problem
-- parrot still panics. (And since we're not accessing the memory through
a (char *), I'm not sure it should make any difference. I'm not a
language lawyer, and I haven't read the standard closely.)
Sh...
Another idea: The context (struct Parrot_Context) is almost only
accessed by the CONTEXT() macro. When now this pointer (ctx.rctx) is
declared being 'void *' it should be compatible with any other pointer
to a structure.
Anyway, the current code is an intermediate step only towards variable
sized register frames. I have to reactivate the alloction code present
also in inter_create.c, when CHUNKED_CTX_MEM is defined as true.
This will very likely also need a split of ctx union into 2 distinct
pointers: ctx.bp (register base pointer) and ctx.rctx (pointer to
Parrot_Context). The allocation will still be like sketched in
inter_create.c:79, i.e. as one block, just the addressing of the 2 items
will be split.
It would be great, if some folks with a stronger C-fu, then I have,
could have a look at it.
... I'd appreciate it if
someone with a faster machine and/or a deeper understanding of what the
code is actually trying to do could hunt it down.
Yep. My Athlon 800 also needs ages to compile it.
leo