Subject: Re: structure padding
To: None <seifert@sequent.com>
From: Gordon W. Ross <gwr@mc.com>
List: tech-kern
Date: 04/01/1997 17:58:48
> Date: Tue, 01 Apr 97 14:45:05 PST
> From: David Seifert <seifert@sequent.com>
> > > Why do you need the `pad[3]' ?
> >
> > There is no "need" for the padding, strictly speaking.
> > However, they represent a "micro-optimization" for m68k
> > machines. [...]
>
> I have to wonder if there are cases where padding could hurt.
> E.g. CPU doesn't care about 32-bit boundaries, but the padding
> causes a cache miss.
>
> Seems like the compiler should handle this, with directives to
> force it one way or another if you want.
>
> -Dave
Well, consider the fact that when fetching a 32-bit word from
an address where the low 3 bits are 010 forces the memory system
to access TWO 32-bit word locations on many m68k machines...
Gordon