Patchwork Move df_live and df_md bitmaps to own obstacks

login
register
mail settings
Submitter Jan Hubicka
Date June 11, 2010, 11:22 a.m.
Message ID <20100611112218.GA17878@atrey.karlin.mff.cuni.cz>
Download mbox | patch
Permalink /patch/55309/
State New
Headers show

Comments

Jan Hubicka - June 11, 2010, 11:22 a.m.
Oops,
I also noticed yesterday that i forgot to free problem_data structures.  I am
testing the following patch and will commit as obvious if it passes.

	* df-problems.c (df_live_free, df_md_free): Free properly the scratch
	bitmaps and free problem_data structure.

Patch

Index: df-problems.c
===================================================================
--- df-problems.c	(revision 160555)
+++ df-problems.c	(working copy)
@@ -1643,10 +1643,11 @@  df_live_free (void)
       free_alloc_pool (df_live->block_pool);
       df_live->block_info_size = 0;
       free (df_live->block_info);
-      bitmap_obstack_release (&problem_data->live_bitmaps);
-
       if (df_live_scratch)
 	BITMAP_FREE (df_live_scratch);
+      bitmap_obstack_release (&problem_data->live_bitmaps);
+      free (problem_data);
+      df_live->problem_data = NULL;
     }
   BITMAP_FREE (df_live->out_of_date_transfer_functions);
   free (df_live);
@@ -4543,8 +4544,12 @@  df_md_free (void)
   struct df_md_problem_data *problem_data
     = (struct df_md_problem_data *) df_md->problem_data;
 
+  if (df_md_scratch)
+    BITMAP_FREE (df_md_scratch);
   bitmap_obstack_release (&problem_data->md_bitmaps);
   free_alloc_pool (df_md->block_pool);
+  free (problem_data);
+  df_md->problem_data = NULL;
 
   df_md->block_info_size = 0;
   free (df_md->block_info);