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: Freeing memory for basic-blocks and edges


On May 29, 2006, at 1:07 PM, sean yang wrote:
For example, I know to allocate a chunk of memory to hold BB information is done by "ggc_alloc_cleared()". But after a function analysis/optimization is done, the memory should be freed.

ggc_free (ptr);


can be used, but, if you use it, you have to be absolutely certain that there doesn't exist a reachable pointer to that memory, anywhere. You must explicitly zero out any old pointers that pointed to the data, if those pointers would have been reachable otherwise.


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