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: Miles Bader
Subject: Re: emacs' turn: remove useless if-before-free tests
Date: Mon, 02 Jun 2008 11:05:55 +0900

YAMAMOTO Mitsuharu <address@hidden> writes:
> 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.

xmalloc can return NULL.

I think xmalloc and xfree should act as much like posix malloc/free as
possible, modulo the error-handling behavior of xmalloc.  That will be
the least surprising to programmers using them.  Indeed, we can make
them act like the posix function even on systems whose native malloc is
less so.

-Miles

-- 
Yo mama's so fat when she gets on an elevator it HAS to go down.




reply via email to

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