From: Phillip Wood Date: Mon, 11 Jul 2022 09:54:56 GMT Subject: Re: [PATCH 7/7] xdiff: remove xdl_free(), use free() instead Message-ID: <81b1f792-f8e9-efa5-fb3f-856264b85287@gmail.com> In-Reply-To: On 11/07/2022 10:26, Phillip Wood wrote: >> For the monkeypatching you do now of creating a "git-xdiff.h" I think it >> would be very good to get a patch like what I managed to get >> sha1collisiondetection.git to accept for our own use-case, which allows >> us to use their upstream code as-is from a submodule: >> >>     https://github.com/cr-marcstevens/sha1collisiondetection/commit/b45fcef >> > > Thanks for the link, That's a really good example where all the > identifiers are namespaced and the public include file does not pollute > the code that is including it. If you come up with something like that > where the client code can set up same #defines for malloc, calloc, > realloc and free that would be a good way forward. To be clear those should be namespaced, so we'd have -Dxdl_malloc=xmalloc (or xmalloc_gently) and libgit2 would have -D xdl_malloc=git__malloc Best Wishes Phillip > I do not think we > should require projects to be defining there own versions of > [C]ALLOC_*() and BUG() just to use xdiff. > > Best Wishes > > Phillip >