emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs' turn: remove useless if-before-free tests


From: YAMAMOTO Mitsuharu
Subject: Re: emacs' turn: remove useless if-before-free tests
Date: Mon, 02 Jun 2008 09:56:56 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/23.0.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Sun, 01 Jun 2008 17:41:02 -0400, Stefan Monnier <address@hidden> said:

> Sounds like a good cleanup.  Feel free to install it unless there's
> a strong objection.

One possible concern is that it will lose programmer's explicit
intention that "this variable may contain either NULL or a return
value of xmalloc" in contrast to "this variable always contain a
return value of xmalloc".

I guess the acceptance of NULL for `free' in POSIX is the reflection
of the fact that `malloc' may return NULL.  If so, we could take a
different policy for `xfree', i.e., abort if NULL, because `xmalloc'
may not return NULL unlike malloc.  This may help us detect the
behavior that is different from programmer's intention.

                                     YAMAMOTO Mitsuharu
                                address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]