This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix insn_locators leak
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 11 Sep 2008 07:42:27 -0400
- Subject: Re: Fix insn_locators leak
- References: <20080911113726.GI3195@kam.mff.cuni.cz>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Sep 11, 2008 at 01:37:26PM +0200, Jan Hubicka wrote:
> + /* Allocate insn locator datastructure. */
> + void
> + insn_locators_free (void)
> + {
> + prologue_locator = epilogue_locator = 0;
> +
> + VEC_free (int, heap, block_locators_locs);
> + VEC_free (tree,gc, block_locators_blocks);
^^ missing space
> + VEC_free (int, heap, locations_locators_locs);
> + VEC_free (location_t, heap, locations_locators_vals);
> + block_locators_locs = NULL;
> + block_locators_blocks = NULL;
> + locations_locators_locs = NULL;
> + locations_locators_vals = NULL;
These 4 lines are unnecessary, VEC_free already clears the variable:
/* Free a vector.
void VEC_T_A_free(VEC(T,A) *&);
Free a vector and set it to NULL. */
and:
static inline void VEC_OP (T,A,free) \
(VEC(T,A) **vec_) \
{ \
if (*vec_) \
vec_##A##_free (*vec_); \
*vec_ = NULL; \
} \
Jakub