Re: [PATCH v2 4/5] config: add git_configset_alloc() and git_configset_clear_and_free()
- From
- phillip.wood123@gmail.com <phillip.wood123@gmail.com>
- Date
- Aug 13, 2024, 09:51 UTC
- Message-ID
- <92278af3-0ade-4e7a-a024-f66b008b9cd2@gmail.com>
- In-Reply-To
- <CAO_smViBnmc4r3MizV5kE406_TvXiwCWtC0jyDb-FT-zp9H9bg@mail.gmail.com>
Hi Kyle
On 12/08/2024 22:55, Kyle Lippincott wrote:
Show 17 quoted lines
> On Mon, Aug 12, 2024 at 2:39 PM Josh Steadmon <steadmon@google.com> wrote: >> Hmmm I see your point, but I am also hoping to keep the symbol export >> shim as small as possible, so that we can try to autogenerate it rather >> than add entries by hand. However, if people feel strongly that we don't >> want to add helper functions like *_alloc() or *_free() for types that don't >> already have them upstream, perhaps we can just put them in a separate >> rust-helpers.c file or something. > > I'm thinking of this patch series as two closely related but > technically separable things: the creation of a .a/.so that can be > used outside of git, and the rust wrapper around that library. I think > these functions would be needed by all users of the library, > regardless of what language they're implemented in. i.e. they > shouldn't be thought of as 'rust helpers' and instead just the way > that the library is designed. _All_ functions that allocate memory > should have a paired "free" method, and that should be used > exclusively, regardless of host language.
Thanks for writing this, I agree we should be designing the library wrapper as a general purpose library, not as an implementation detail of the rust code.
Best Wishes
Phillip
> So nit: I wouldn't call it rust-helpers.c ;)