Re: [PATCH 10/18] alternates: provide helper for allocating alternate

2016-10-03 Thread Jacob Keller
On Mon, Oct 3, 2016 at 1:35 PM, Jeff King wrote: > Allocating a struct alternate_object_database is tricky, as > we must over-allocate the buffer to provide scratch space, > and then put in particular '/' and NUL markers. > > Let's encapsulate this in a function so that the complexity > doesn't le

[PATCH 10/18] alternates: provide helper for allocating alternate

2016-10-03 Thread Jeff King
Allocating a struct alternate_object_database is tricky, as we must over-allocate the buffer to provide scratch space, and then put in particular '/' and NUL markers. Let's encapsulate this in a function so that the complexity doesn't leak into callers (and so that we can modify it later). Signed