This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: malloc attributes and realloc
On Fri, 2 Jan 2004, Gabriel Dos Reis wrote:
> I think we'd better off not listing realloc for reasons exposed in
> this thread.
Then we'd better have appropriate wording so that users can determine
whether their realloc-like function is one that can have the attribute or
not (depending on the specification of how their function may be used).
Certainly, a function that mallocs space for the new copy of the data,
copies it then frees the old space is a candidate for the attribute - but
so surely is one that copies the data somewhere temporary, frees the old
space then mallocs the new space (even if the pointers might sometimes
happen to have the same bit-pattern).
--
Joseph S. Myers
jsm@polyomino.org.uk