At 9:41 AM +0100 10/30/02, Leopold Toetsch wrote:
I'm comfortable with this. If extensions use stack-allocated structs that have misaligned PMC/Buffer pointers in them, then the extension authors can darned well explicitly register the pointers for their lifetime. Except in rare and bizarre cases, it would have to be done explicitly--it's not like too many system structs are going to have pointers to our stuff in them.Jason Gloudon wrote:So, this "someone" are we (parrot itself) + language extensions (PXS) which have to be compiled with the same compiler options, parrot is compiled with.... By default both compilers align stack variables at their natural alignment, so PMC pointers would normally fall on 4 byte boundaries. However, it is also possible that someone might save a PMC pointer to an unaligned address on the stack (I can't imagine why). We could always say "don't do that!" for performance reasons.
Using packed structures with PMCs/Buffers inside is a strict "don't do that!".
Definitely warrants a big warning in the extension docs, but that's fine. Also warrants some seriously heavy-duty tests in the test suite to make sure we don't trip over compiler bugs or other strange things that would bite us because of this.
--
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk