This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: malloc.c defining an assert macro
On Mon, 29 Jan 2018, Samuel Thibault wrote:
> Joseph Myers, on lun. 29 janv. 2018 16:07:31 +0000, wrote:
> > First, is there any reason malloc.c needs its own assert macro?
>
> Malloc's assert avoids using malloc() whenever possible :)
Maybe then it should include <assert.h>, and then define __assert_fail as
a macro pointing to its own equivalent malloc-avoiding function? So it
gets the macro from <assert.h> but replaces the underlying function in a
malloc-avoiding way.
--
Joseph S. Myers
joseph@codesourcery.com