+2015-06-10 Martin Liska <mliska@suse.cz>
+
+ PR bootstrap/66471
+ * mem-stats-traits.h (enum mem_alloc_origin): Add _ORIGIN suffix for
+ all enum values in mem_alloc_origin.
+ * alloc-pool.c (dump_alloc_pool_statistics): Use newly changed enum
+ name.
+ * alloc-pool.h (pool_allocator::pool_allocator): Likewise.
+ * bitmap.c (bitmap_register): Likewise.
+ (dump_bitmap_statistics): Likewise.
+ * ggc-common.c (dump_ggc_loc_statistics): Likewise.
+ (ggc_record_overhead): Likewise.
+ * hash-map.h: Likewise.
+ * hash-set.h: Likewise.
+ * hash-table.c (void dump_hash_table_loc_statistics): Likewise.
+ * hash-table.h: Likewise.
+ * vec.c (vec_prefix::register_overhead): Likewise.
+ (vec_prefix::release_overhead): Likewise.
+ (dump_vec_loc_statistics): Likewise.
+
2015-06-09 Christian Bruel <christian.bruel@st.com>
PR target/52144
if (! GATHER_STATISTICS)
return;
- pool_allocator_usage.dump (ALLOC_POOL);
+ pool_allocator_usage.dump (ALLOC_POOL_ORIGIN);
}
m_elts_free (0), m_blocks_allocated (0), m_block_list (NULL),
m_block_size (0), m_ignore_type_size (ignore_type_size),
m_extra_size (extra_size), m_initialized (false),
- m_location (ALLOC_POOL, false PASS_MEM_STAT) {}
+ m_location (ALLOC_POOL_ORIGIN, false PASS_MEM_STAT) {}
/* Initialize a pool allocator. */
void
bitmap_register (bitmap b MEM_STAT_DECL)
{
- bitmap_mem_desc.register_descriptor (b, BITMAP, false FINAL_PASS_MEM_STAT);
+ bitmap_mem_desc.register_descriptor (b, BITMAP_ORIGIN, false
+ FINAL_PASS_MEM_STAT);
}
/* Account the overhead. */
if (! GATHER_STATISTICS)
return;
- bitmap_mem_desc.dump (BITMAP);
+ bitmap_mem_desc.dump (BITMAP_ORIGIN);
}
DEBUG_FUNCTION void
ggc_force_collect = true;
ggc_collect ();
- ggc_mem_desc.dump (GGC, final ? ggc_usage::compare_final : NULL);
+ ggc_mem_desc.dump (GGC_ORIGIN, final ? ggc_usage::compare_final : NULL);
ggc_force_collect = false;
}
void
ggc_record_overhead (size_t allocated, size_t overhead, void *ptr MEM_STAT_DECL)
{
- ggc_usage *usage = ggc_mem_desc.register_descriptor (ptr, GGC, false
+ ggc_usage *usage = ggc_mem_desc.register_descriptor (ptr, GGC_ORIGIN, false
FINAL_PASS_MEM_STAT);
ggc_mem_desc.register_object_overhead (usage, allocated + overhead, ptr);
public:
explicit hash_map (size_t n = 13, bool ggc = false,
bool gather_mem_stats = true CXX_MEM_STAT_INFO)
- : m_table (n, ggc, gather_mem_stats, HASH_MAP PASS_MEM_STAT) {}
+ : m_table (n, ggc, gather_mem_stats, HASH_MAP_ORIGIN PASS_MEM_STAT) {}
/* Create a hash_map in ggc memory. */
static hash_map *create_ggc (size_t size, bool gather_mem_stats = true
public:
explicit hash_set (size_t n = 13, bool ggc = false CXX_MEM_STAT_INFO)
- : m_table (n, ggc, true, HASH_SET PASS_MEM_STAT) {}
+ : m_table (n, ggc, true, HASH_SET_ORIGIN PASS_MEM_STAT) {}
/* Create a hash_set in gc memory with space for at least n elements. */
/* Support function for statistics. */
void dump_hash_table_loc_statistics (void)
{
- for (unsigned i = HASH_TABLE; i <= HASH_SET; i++)
+ for (unsigned i = HASH_TABLE_ORIGIN; i <= HASH_SET_ORIGIN; i++)
{
mem_alloc_origin origin = (mem_alloc_origin) i;
hash_table_usage.dump (origin);
public:
explicit hash_table (size_t, bool ggc = false, bool gather_mem_stats = true,
- mem_alloc_origin origin = HASH_TABLE
+ mem_alloc_origin origin = HASH_TABLE_ORIGIN
CXX_MEM_STAT_INFO);
~hash_table ();
create_ggc (size_t n CXX_MEM_STAT_INFO)
{
hash_table *table = ggc_alloc<hash_table> ();
- new (table) hash_table (n, true, true, HASH_TABLE PASS_MEM_STAT);
+ new (table) hash_table (n, true, true, HASH_TABLE_ORIGIN PASS_MEM_STAT);
return table;
}
/* Memory allocation origin. */
enum mem_alloc_origin
{
- HASH_TABLE,
- HASH_MAP,
- HASH_SET,
- VEC,
- BITMAP,
- GGC,
- ALLOC_POOL,
+ HASH_TABLE_ORIGIN,
+ HASH_MAP_ORIGIN,
+ HASH_SET_ORIGIN,
+ VEC_ORIGIN,
+ BITMAP_ORIGIN,
+ GGC_ORIGIN,
+ ALLOC_POOL_ORIGIN,
MEM_ALLOC_ORIGIN_LENGTH
};
vec_prefix::register_overhead (void *ptr, size_t size, size_t elements
MEM_STAT_DECL)
{
- vec_mem_desc.register_descriptor (ptr, VEC, false FINAL_PASS_MEM_STAT);
+ vec_mem_desc.register_descriptor (ptr, VEC_ORIGIN, false
+ FINAL_PASS_MEM_STAT);
vec_usage *usage = vec_mem_desc.register_instance_overhead (size, ptr);
usage->m_items += elements;
if (usage->m_items_peak < usage->m_items)
MEM_STAT_DECL)
{
if (!vec_mem_desc.contains_descriptor_for_instance (ptr))
- vec_mem_desc.register_descriptor (ptr, VEC, false FINAL_PASS_MEM_STAT);
+ vec_mem_desc.register_descriptor (ptr, VEC_ORIGIN,
+ false FINAL_PASS_MEM_STAT);
vec_mem_desc.release_instance_overhead (ptr, size, in_dtor);
}
void
dump_vec_loc_statistics (void)
{
- vec_mem_desc.dump (VEC);
+ vec_mem_desc.dump (VEC_ORIGIN);
}