Re: [dev] [st] [PATCH] Optimize memory footprint of line buffers

From: suigin <suigin_AT_national.shitposting.agency>
Date: Mon, 27 Apr 2015 08:29:25 -0700

On Mon, Apr 27, 2015 at 07:34:01AM -0700, suigin wrote:
> As you can see, it's actually 2 bytes less. This is because a struct
> is usually aligned to the maximum alignment of all fields. A 16-bit
> ushort has a 2-byte alignment on x86_64, so this forces the struct
> to also have an alignment of 2-bytes, and thus it has to insert two
> extra padding bytes at the end of the struct to maintain the alignment
> across an array of these structs.

Sorry, there aren't actually two extra padding bytes, even though the
struct is two bytes longer in length. Don't know what I was thinking.
Time for a coffee.

Anyway, you get the idea.

Received on Mon Apr 27 2015 - 17:29:25 CEST

This archive was generated by hypermail 2.3.0 : Mon Apr 27 2015 - 17:36:09 CEST