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]

You introduced a memory leak with the IPA-SSA stuff


It used to be that the bitmap obstack known as "alias_bitmap_obstack"
was released and renewed every time we called compute_may_aliases.
This didn't really leak because the absolute last one was destroyed at
the end of compilation.

You changed it to be only released if gimple_aliases_computed_p (cfun).

This of course, leaks all the bitmaps in that obstack whenever we
change functions, because bitmap_obstack_initialize does not free the
old obstack if it is still in use, it just leaks it.

The code needs to be something like
  if (alias_bitmap_obstack.elements != NULL)
    bitmap_obstack_release (&alias_bitmap_obstack);
  bitmap_obstack_initialize (&alias_bitmap_obstack);

(or some other approriate thing :P)

Right now we leak a couple meg per function if they have a lot of
symbols, we'd leak more otherwise.
--Dan


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