Re: [PATCH 3/3] Documentation: document difference between release and free
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jul 24, 2024, 13:11 UTC
- Message-ID
- <ZqD9keTtimiqJnJP@tanuki>
- In-Reply-To
- <CAOLa=ZScBn+sMB7BWMpsS=Ld0sUW14Li5JVuKPGKtY91hVo4jA@mail.gmail.com>
On Wed, Jul 24, 2024 at 04:46:20AM -0700, Karthik Nayak wrote:
Show 9 quoted lines
> Patrick Steinhardt <ps@pks.im> writes: > > > We semi-regularly have discussions around whether a function shall be > > named `release()` or `free()`. For most of the part we use these two > > terminologies quite consistently though: > > > > I noticed there is also `clear()` used in some places. Should we also > mention that we don't recommend using `clear()` WRT freeing memory?
In any case I think we should decide on eithe using `clear()` or using `release()` for consistency's sake. Which of both we use I don't quite care, but the following very shoddy analysis clearly favors `release()`:
$ git grep '_clear(' | wc -l
844
$ git grep '_release(' | wc -l
2126So yeah, I'm happy to explicitly mention that `clear()` shouldn't be used in favor of `release()`.
Patrick