[haiku-development] Re: ext3 Journal WIP patch

  • From: Rene Gollent <anevilyak@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 16 Apr 2010 14:32:48 -0400

On Fri, Apr 16, 2010 at 2:28 PM, Janito Ferreira Filho
<jvffprog@xxxxxxxxxxx> wrote:
> I'll add the _PACKED attribute to the appropriate structures. BTW, could you
> give a brief explanation on what it changes (or in what it restricts the
> compiler)?

It instructs the compiler to not pad the structure to fit memory
alignment restrictions. Otherwise some pad bytes might be added to
align it, which won't play well in the disk scenario. (i.e. if 32-bit
word alignment is expected, and you create a struct with 2 bytes in
it, the resulting struct would wind up being allocated/sized as 4
bytes unless _PACKED is specified)



Other related posts: