From: Jonathan Nieder Date: Mon, 12 Oct 2020 15:25:05 GMT Subject: Re: [PATCH v2 05/13] reftable: utility functions Message-ID: <20201012152505.GB3740546@google.com> In-Reply-To: (+cc: Patrick Steinhardt from libgit2) Hi, Han-Wen Nienhuys wrote[1]: > On Fri, Oct 2, 2020 at 6:12 AM Jonathan Nieder wrote: >> Han-Wen Nienhuys wrote: >>> + 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