As a general rule of thumb, if you sort your structs into decreasing
size, it usually comes out right. That is, put all your 64-bit items
first, then all your 32-bit items, then 16-bit, then 8-bit. Then there
are no "holes" except the one at the end, which most compilers are
pretty good at keepi
At 09:05 PM 4/17/2001 +0100, Alan Burlison wrote:
>Uri Guttman wrote:
>
> > malloc normally doesn't care about alignment.
>
>I'll think you will find it does care.
I'm pretty sure that everyone's malloc returns data aligned to the CPU's
favorite boundary. It's what we do with the malloc'd area t
Uri Guttman wrote:
> malloc normally doesn't care about alignment.
I'll think you will find it does care.
Alan Burlison
> "NC" == Nicholas Clark <[EMAIL PROTECTED]> writes:
NC> On Fri, Apr 13, 2001 at 04:38:45PM -0400, Dan Sugalski wrote:
>> It actually matters more for dynamic data structures, as compilers
>> tend to queitly align things well for you. It's tough to get stack
>> variables unaligned, b
On Fri, Apr 13, 2001 at 04:38:45PM -0400, Dan Sugalski wrote:
> It actually matters more for dynamic data structures, as compilers tend to
> queitly align things well for you. It's tough to get stack variables
> unaligned, but it's pretty easy to get dynamically allocated ones all messy.
At whi
At 06:36 PM 4/12/2001 -0400, Uri Guttman wrote:
> > "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes:
>
> DS> The only difference between the aligned and unaligned runs is the
> DS> pointer to the aligned data is on an 8-byte boundary, and the
> DS> unaligned data is the aligned pointer p
> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes:
DS> The only difference between the aligned and unaligned runs is the
DS> pointer to the aligned data is on an 8-byte boundary, and the
DS> unaligned data is the aligned pointer plus 1.
i am assuming this is an alpha (which i got to kn
At 12:15 AM 4/13/2001 +0200, Kai Henningsen wrote:
>[EMAIL PROTECTED] (Dan Sugalski) wrote on 12.04.01 in
><[EMAIL PROTECTED]>:
>
> > (No, I don't know why unaligned access to 8-bit data is faster, but there
> > you go)
>
>How *do* you unalign 8-bit data?!
(Must... resist... straight... line...
[EMAIL PROTECTED] (Dan Sugalski) wrote on 12.04.01 in
<[EMAIL PROTECTED]>:
> (No, I don't know why unaligned access to 8-bit data is faster, but there
> you go)
How *do* you unalign 8-bit data?!
MfG Kai
It does. I ran a test here earlier today on the cost of mis-aligned data
access, and I figured the results would be of interest to folks in general.
A few caveats--this test was run on a lightly loaded Compaq TurboLaser with
6 700MHz EV6 processors and 16G of memory. There was no swapping, and
10 matches
Mail list logo