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

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

Thread Previous | Thread Next
Dan Sugalski
October 29, 2002 07:25
Re: [perl #18127] [PATCH] Implicit stack direction probe
Message ID:
At 3:27 PM +0100 10/29/02, Leopold Toetsch wrote:
>Jason Gloudon wrote:
>>On Tue, Oct 29, 2002 at 02:40:14PM +0100, Leopold Toetsch wrote:
>>>>+        cur_var_ptr = (size_t)((ptrdiff_t)cur_var_ptr + 
>>>When PARROT_PTR_ALIGNMENT is not 1, that much pointers -1 are 
>>>skipped during stack scanning by incrementing cur_var_ptr by 
>>>sizeof(size_t) * PARROT_PTR_ALIGNMENT bytes.
>>ptrdiff_t is not a pointer type, so cur_var_ptr + PARROT_PTR_ALIGNMENT skips
>>exactly PARROT_PTR_ALIGNMENT bytes. You may not be matching ( )'s 
>>quite right.
>Brr, yes. I checked with gdb. cur_var_ptr is incremented by 
>PARROT_PTR_ALIGNMENT _bytes_ i.e. by 1 byte on i386. Can we really 
>have e.g. odd aligned PMCs on stack? I don't think so. Or am I still 
>missing something?

There was some indication back when this was first implemented that 
the i386, at least when running windows, could have odd-aligned 
pointers in stack-allocated data. Nobody was 100% sure, but better 
safe than not, at least until someone can say definitively that we're 
being too cautious.

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai                         have teddy bears and even
                                       teddy bears get drunk

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