This is the mail archive of the gcc-patches@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: Fix insn_locators leak


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


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