Re: [PATCH v2 05/13] reftable: utility functions
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Oct 12, 2020, 15:25 UTC
- Message-ID
- <20201012152505.GB3740546@google.com>
- In-Reply-To
- <CAFQ2z_NL1UrmonMH3qLKrEkjsPjm9qTbtoeY0OHQZzkVW2t3-w@mail.gmail.com>
(+cc: Patrick Steinhardt from libgit2) Hi,
Han-Wen Nienhuys wrote[1]:
> On Fri, Oct 2, 2020 at 6:12 AM Jonathan Nieder <jrnieder@gmail.com> wrote: >> Han-Wen Nienhuys wrote:
Show 7 quoted lines
>>> + reftable_free(a); >>> +} >> >> Are there other callers that need custom free? > > The libgit2 folks requested the ability to set memory allocation > routines, hence reftable_free().
Thanks. Patrick or Han-Wen, can you say a little more about this use case? That would help with making sure we are making an API that meets its needs.
For example, is a custom allocator something that would be set globally or something attached to a handle? If the former, would code that uses xmalloc and free and gets #define-d away when used in libgit2 work? If the latter, what does the handle look like?
Thanks, Jonathan
[1] context: https://lore.kernel.org/git/pull.847.git.git.1600283416.gitgitgadget@gmail.com/T/#r2337ddc80848c80f6c9699d904ab64d4297d2c54