Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 6 Sep 2015 12:30:28 -0500
From: JimF <jfoug@....net>
To: john-dev@...ts.openwall.com
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];

into
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

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ