This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: malloc attributes and realloc
> It improved compilation time by around 0.5%.
>
> Did we achieve consensus that having the attribute on (x)realloc is
> appropriate? (Can you point out the confirming URLs? This
> conversation has gone on for a bit...) If so I'll submit a patch to
> put the attribute on both realloc and xrealloc.
I am certain that there is no consensus. My biased eyes believe that
most think the attribute is inappropriate either because POSIX made
a mistake or because being to strict with the realloc function will
not provide enough benefits to compensate for the certain problems.
Now, if GCC itself is aliasing clean with realloc, and if there were
a way to say, "I use realloc's result as if it were a malloc result",
then it would certainly be OK to put such hints into GCC's source.
It doesn't look OK to put that hint into libc, leastwise from my read
of what folks are saying on this thread.