Re: [PATCH 04/18] add helpers for allocating flex-array structs

2016-02-15 Thread Jeff King
On Mon, Feb 15, 2016 at 08:47:30PM -0500, Eric Sunshine wrote: > > This patch adds a few helpers to turn simple cases of into a > > Grammo: "cases of into" Oops. Cases of "flex-array struct allocation into...". > > + * and "name" will point to a block of memory after the struct, which will > >

Re: [PATCH 04/18] add helpers for allocating flex-array structs

2016-02-15 Thread Eric Sunshine
On Mon, Feb 15, 2016 at 4:50 PM, Jeff King wrote: > Allocating a struct with a flex array is pretty simple in > practice: you over-allocate the struct, then copy some data > into the over-allocation. But it can be a slight pain to > make sure you're allocating and copying the right amounts. > > Th

[PATCH 04/18] add helpers for allocating flex-array structs

2016-02-15 Thread Jeff King
Allocating a struct with a flex array is pretty simple in practice: you over-allocate the struct, then copy some data into the over-allocation. But it can be a slight pain to make sure you're allocating and copying the right amounts. This patch adds a few helpers to turn simple cases of into a one