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

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

Thread Previous | Thread Next
From:
Jason Gloudon
Date:
October 29, 2002 13:07
Subject:
Re: [perl #18127] [PATCH] Implicit stack direction probe
Message ID:
20021029210634.GA11414@gloudon.com
On Tue, Oct 29, 2002 at 12:17:55PM -0600, Garrett Goebel wrote:
> Dan Sugalski wrote:
> > Leopold Toetsch wrote:
> > >
> > > Can we really have e.g. odd aligned PMCs on stack?
> >
> > the specs are available *somewhere*, and we should see
> > about digging them up and getting a final answer one way
> > or another.

The system V ABI for IA-32(32-bit x86) does not specify how a compiler should
align local variables on the stack. There are ABI rules for aligning structure
members, and variables passed between functions, but both Visual C++ and gcc
allow the programmer to request packing of structures which ignores these
rules. 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.

-- 
Jason

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About