This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Freeing memory for basic-blocks and edges
- From: Mike Stump <mrs at apple dot com>
- To: sean yang <seanatpurdue at hotmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 30 May 2006 11:08:56 -0700
- Subject: Re: Freeing memory for basic-blocks and edges
- References: <BAY105-F9ADE39020704C279D568EC09D0@phx.gbl>
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.