Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 6 Sep 2015 12:30:28 -0500
From: JimF <>
Subject: Re: Large stack alignment

On 9/6/2015 12:16 PM, Solar Designer wrote:
> That's great, but I think there's still performance impact potential:
> all those individual pointers may need their own registers, whereas
> without such per-pointer alignment gcc would simply address everything
> relative to a single frame pointer register.
> Alexander
Could this be handled with a union, where you define all of the arrays 
in that union, and then simply move the whole thing forward X number of 
bytes?  Or would this cause a double access, first to access the pointer 
of the union, then to offset from that pointer to find the element (then 
possibly a 3rd to access offset within that buffer) ?

If not, then turning

type buf1[X];
type buf2[Y];

typedef struct {type buf1[x]; type buf2[Y]} buftype;
char _buf[sizeof(buftype)+align];
buftype *buf = mem_align(_buf, align);

How does that look?  Yes, now we have to change all buf1[x] into buf->buf1[x]  but do you see this as just compiler eye candy, or is there still compiler performance issues here ?

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.