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: 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~


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