Patchwork C++ PATCH to objc-map.c to fix build with --enable-gather-detailed-mem-stats

login
register
mail settings
Submitter Jason Merrill
Date March 5, 2012, 9:17 p.m.
Message ID <4F552D67.9040007@redhat.com>
Download mbox | patch
Permalink /patch/144773/
State New
Headers show

Comments

Jason Merrill - March 5, 2012, 9:17 p.m.
objc-map.c has been calling _stat allocation functions without using 
MEM_STAT_INFO for passing the file location information to the 
allocator, which breaks bootstrap with 
--enable-gather-detailed-mem-stats.  Fixed by calling the non-_stat 
variant instead.

Applying as obvious.
Jason Merrill - March 5, 2012, 9:17 p.m.
Er, not actually a C++ patch.  Fingers on autopilot...

Patch

commit c70308c0c323642d823af0c4e7a6ed5e320b499f
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Mar 5 16:12:13 2012 -0500

    	* objc-map.c (objc_map_private_resize, objc_map_alloc_ggc): Don't
    	call _stat functions without MEM_STAT_INFO.

diff --git a/gcc/objc/objc-map.c b/gcc/objc/objc-map.c
index 77a98c1..a4a1eec 100644
--- a/gcc/objc/objc-map.c
+++ b/gcc/objc/objc-map.c
@@ -56,7 +56,7 @@  next_power_of_two (size_t x)
 objc_map_t
 objc_map_alloc_ggc (size_t initial_capacity)
 {
-  objc_map_t map = (objc_map_t) ggc_internal_cleared_vec_alloc_stat (1, sizeof (struct objc_map_private));
+  objc_map_t map = (objc_map_t) ggc_internal_cleared_vec_alloc (1, sizeof (struct objc_map_private));
   if (map == NULL)
     OUT_OF_MEMORY;
   
@@ -67,8 +67,8 @@  objc_map_alloc_ggc (size_t initial_capacity)
   map->maximum_load_factor = 70;
   map->max_number_of_non_empty_slots = (initial_capacity * map->maximum_load_factor) / 100;
 
-  map->slots = (tree *)ggc_internal_cleared_vec_alloc_stat (initial_capacity, sizeof (tree));
-  map->values = (tree *)ggc_internal_cleared_vec_alloc_stat (initial_capacity, sizeof (tree));
+  map->slots = (tree *)ggc_internal_cleared_vec_alloc (initial_capacity, sizeof (tree));
+  map->values = (tree *)ggc_internal_cleared_vec_alloc (initial_capacity, sizeof (tree));
 
   if (map->slots == NULL)
     OUT_OF_MEMORY;
@@ -112,8 +112,8 @@  objc_map_private_resize (objc_map_t map, size_t new_number_of_slots)
   map->max_number_of_non_empty_slots = (map->number_of_slots * map->maximum_load_factor) / 100;
 
 
-  map->slots = (tree *)ggc_internal_cleared_vec_alloc_stat (map->number_of_slots, sizeof (tree));
-  map->values = (tree *)ggc_internal_cleared_vec_alloc_stat (map->number_of_slots, sizeof (tree));
+  map->slots = (tree *)ggc_internal_cleared_vec_alloc (map->number_of_slots, sizeof (tree));
+  map->values = (tree *)ggc_internal_cleared_vec_alloc (map->number_of_slots, sizeof (tree));
 
   if (map->slots == NULL)
     OUT_OF_MEMORY;