This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Can realloc be marked as a mallloc-like function?
On Tue, Jul 17, 2007 at 09:53:30AM -0000, Wolfram Gloger wrote:
> Surely you agree that in my second example, "*p = 0" _cannot_ be moved
> after the call to destroy_something_and_allocate_anotherthing(p)?
It can't be moved after, but it could be removed entirely as dead code.
I don't think we have a pass that will do that presently, but I see no
reason why it couldn't happen some day, more or less automatically, with
a pass that analyzes lifetimes of dynamic allocations.
r~