Eric Wong <e...@80x24.org> writes:

> Jonathan Nieder <jrnie...@gmail.com> wrote:
>> Hi,
>> 
>> Ævar Arnfjörð Bjarmason wrote:
>> 
>> > Add a FREEZ() wrapper marco for the common pattern of freeing a
>> > pointer and assigning NULL to it right afterwards.
>> 
>> I'm conflicted.  On one hand it makes code more concise and makes it
>> easier for people to remember to assign NULL after freeing a variable.
>> On the other hand it makes git more of a custom dialect of C, which
>> may make the code harder to read and hack on for new contributors.
>
> I think this problem could be avoided by using a more explicit
> name, perhaps: "free_and_null"
>
> Seeing the initial subject, I thought this series was short for
> "freeze" (like "creat").

Both match my thoughts exactly ;-)

> ...
> I don't see the point of a macro wrapper, forcing the user to
> type out the '&' should drive home the point that the pointer
> gets set to NULL.  I also find capitalization tiring-to-read
> because all characters are the same height.

Sounds sensible.

So make Jonathan's freez_impl a public API and rename it to
free_and_null(), perhaps?

Reply via email to