This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: malloc attributes and realloc


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.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]