This is the mail archive of the
mailing list for the GCC project.
Re: malloc attributes and realloc
Gabriel Dos Reis <email@example.com> 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.
Andreas Schwab, SuSE Labs, firstname.lastname@example.org
SuSE Linux AG, MaxfeldstraÃe 5, 90409 NÃrnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."