Re: [PATCH v2 05/13] reftable: utility functions
- From
Han-Wen Nienhuys <hanwen@google.com>
- Date
- Oct 10, 2020, 17:32 UTC
- Message-ID
- <CAFQ2z_NL1UrmonMH3qLKrEkjsPjm9qTbtoeY0OHQZzkVW2t3-w@mail.gmail.com>
- In-Reply-To
- <20201002041214.GE3252492@google.com>
On Fri, Oct 2, 2020 at 6:12 AM Jonathan Nieder <jrnieder@gmail.com> wrote:
> [...] > > +int binsearch(size_t sz, int (*f)(size_t k, void *args), void *args) > > How does this compare to stdlib's bsearch?
bsearch gives you back NULL if it doesn't find an exact match.
> > + 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().
-- Han-Wen Nienhuys - Google Munich I work 80%. Don't expect answers from me on Fridays. -- Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Paul Manicle, Halimah DeLaine Prado