Re: [PATCH 7/7] xdiff: remove xdl_free(), use free() instead
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Jul 11, 2022, 09:54 UTC
- Message-ID
- <81b1f792-f8e9-efa5-fb3f-856264b85287@gmail.com>
- In-Reply-To
- <dcde61a3-4d96-6cd5-f05e-45781599f8bd@gmail.com>
On 11/07/2022 10:26, Phillip Wood wrote:
Show 13 quoted lines
>> 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
Show 8 quoted lines
> 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 >