Re: [RFC PATCH 3/6] contrib/cgit-rs: introduce Rust wrapper for libgit.a
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 8, 2024, 02:21 UTC
- Message-ID
- <xmqqo763lppr.fsf@gitster.g>
- In-Reply-To
- <ZrQJe32sYNOTSJGf@tapette.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 5 quoted lines
> I think if we're going to be writing a general purpose API for > libification, we probably should provide free functions. Normally, that > will be a call to free(3), but in some cases we may need more complex > logic, and by providing those, we're making the API more consistent and > easy to use.
Do you mean that we should have variants of free() that are specific to each data structure? E.g., Patrick taught fetch_task_release() to release the task structure itself, in addition to the resources it holds, while renaming fetch_task_release() to fetch_task_free(), with ff25992c (submodule: fix leaking fetch tasks, 2024-08-07), so if cgit-sys wants to expose fetch_task object to the outside world, the consumers would call fetch_task_free() on it?