Re: packing structures and numbers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 03 October 2008 05:22, Chris Mason wrote:
> On Fri, 2008-10-03 at 14:42 +0300, Avi Kivity wrote:
> > I've been reading btrfs's on-disk format, and two things caught my eye
> > 
> > - attribute((packed)) structures everywhere, often with misaligned 
> > fields.  This conserves space, but can be harmful to in-memory 
> > performance on some archs.
> 
> packed is important to make sure that a given field takes exactly the
> same amount of space everywhere, regardless of compiler optimization or
> arch.

Amen.  Are we sure that attribute ((packed)) works the same on all
arches?

And what about bitfields, does GCC pack them to the same size on all
arches in this case or take the easy way out as permitted by the
standard?

Regards,

Daniel
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux