Re: [PATCH 05/24] revision.[ch]: provide and start using a release_revisions()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 10, 2022, 01:11 UTC
- Message-ID
- <xmqqee3aipbz.fsf@gitster.g>
- In-Reply-To
- <220310.864k46lk7x.gmgdl@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> So I'd prefer to keep this part of the general structure as-is, > i.e. even if we do nothing with "diffopt" *yet* we can assert ...
Please don't.
It will become hard to tell during the patch progression if "we can do so even though we do not need to do so *yet*" is correct (e.g. diffopt---which does not have a separate allocation to be released), or if "pretending that the field is cleared by _release() function is premature and will lead to a new leak" (e.g. if you lost separate clearing of .prune_data at this step, that would be an incorrect change because it does hold on to an allocated resource).