develooper Front page | perl.perl6.internals | Postings from October 2002

Re: [perl #18127] [PATCH] Implicit stack direction probe

Thread Previous | Thread Next
Leopold Toetsch
October 30, 2002 00:43
Re: [perl #18127] [PATCH] Implicit stack direction probe
Message ID:
Jason Gloudon wrote:

> ... 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.

So, this "someone" are we (parrot itself) + language extensions (PXS) 
which have to be compiled with the same compiler options, parrot is 
compiled with.
Using packed structures with PMCs/Buffers inside is a strict "don't do 

Now, given above rules and _if_ each machine parrot is running on, 
aligns a (PMC *)p at sizeof(PMC*) on the stack, we can safely define our 
{lo,hi}_var_ptrs as PMC** and just iterate the $stack_p++.

If there are machines/compilers out there, that don't follow above rule, 
we put some #ifdefs in trace_system_stack for these.

This part is too time critical to program for the LCD.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About