This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: malloc attributes and realloc
Andreas Schwab <schwab@suse.de> writes:
| Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
|
| > I think we'd better off not listing realloc for reasons exposed in
| > this thread.
|
| Perhaps it would be worthwhile to define a realloc attribute. That
| would have the opportunity to optimize code like this:
|
| c1 = *p1;
| p2 = realloc(p1, n);
| c2 = *p2;
|
| because we know that c1 == c2.
That makes sense.
Do we have some kind of data whether such codes are widespread?
-- aby