225 uint64_t nsearches, uint64_t search_iter)
244 char *location_string = loc->
to_string ();
246 fprintf (stderr,
"%-48s " PRsa (9)
":%5.1f%%"
254 loc->
m_ggc ?
"ggc" :
"heap");
256 free (location_string);
263 fprintf (stderr,
"%-48s %11s%16s%17s%12s%12s%10s\n", name,
"Leak",
"Peak",
264 "Times",
"N searches",
"Search iter",
"Type");
281#define BITMAP_WORD_BITS (CHAR_BIT * SIZEOF_LONG * 1u)
285#ifndef BITMAP_ELEMENT_WORDS
286#define BITMAP_ELEMENT_WORDS ((128 + BITMAP_WORD_BITS - 1) / BITMAP_WORD_BITS)
291#define BITMAP_ELEMENT_ALL_BITS (BITMAP_ELEMENT_WORDS * BITMAP_WORD_BITS)
333 : indx (0), tree_form (
false), padding (0), alloc_descriptor (0), first (
NULL),
359 unsigned *get_descriptor ()
361 return (
unsigned *)(ptrdiff_t)(alloc_descriptor << 3);
415#define bitmap_compl_and(DST, A, B) bitmap_and_compl (DST, B, A)
472 head->alloc_descriptor = 0;
474 if (GATHER_STATISTICS)
492#define BITMAP_ALLOC bitmap_alloc
494#define BITMAP_GGC_ALLOC bitmap_gc_alloc
513#define BITMAP_FREE(BITMAP) \
514 ((void) (bitmap_obstack_free ((bitmap) BITMAP), (BITMAP) = (bitmap) NULL))
540 unsigned start_bit,
unsigned *bit_no)
574 start_bit += !bi->
bits;
584 unsigned start_bit,
unsigned *bit_no)
586 bi->
elt1 = map1->first;
587 bi->
elt2 = map2->first;
644 start_bit += !bi->
bits;
654 unsigned start_bit,
unsigned *bit_no)
656 bi->
elt1 = map1->first;
657 bi->
elt2 = map2->first;
694 start_bit += !bi->
bits;
714#if (GCC_VERSION >= 3004)
716 unsigned int n = __builtin_ctzl (bi->
bits);
722 while (!(bi->
bits & 1))
918#ifndef EXECUTE_IF_SET_IN_BITMAP
920#define EXECUTE_IF_SET_IN_BITMAP(BITMAP, MIN, BITNUM, ITER) \
921 for (bmp_iter_set_init (&(ITER), (BITMAP), (MIN), &(BITNUM)); \
922 bmp_iter_set (&(ITER), &(BITNUM)); \
923 bmp_iter_next (&(ITER), &(BITNUM)))
931#define EXECUTE_IF_AND_IN_BITMAP(BITMAP1, BITMAP2, MIN, BITNUM, ITER) \
932 for (bmp_iter_and_init (&(ITER), (BITMAP1), (BITMAP2), (MIN), \
934 bmp_iter_and (&(ITER), &(BITNUM)); \
935 bmp_iter_next (&(ITER), &(BITNUM)))
942#define EXECUTE_IF_AND_COMPL_IN_BITMAP(BITMAP1, BITMAP2, MIN, BITNUM, ITER) \
943 for (bmp_iter_and_compl_init (&(ITER), (BITMAP1), (BITMAP2), (MIN), \
945 bmp_iter_and_compl (&(ITER), &(BITNUM)); \
946 bmp_iter_next (&(ITER), &(BITNUM)))
974template<
typename T,
typename Traits = array_traits<T> >
992template<
typename T,
typename Traits>
1001 static const size_t num_bitmap_elements
1003 *
sizeof (
typename Traits::element_type)
1004 * Traits::constant_size,
1012template<
typename T,
typename Traits>
1016 m_head.obstack =
NULL;
1030 unsigned int indx = 0;
1031 for (
size_t array_base = 0;
1033 array_base += array_step, indx += 1)
1036 unsigned int array_count
1042 for (
size_t i = 1;
i < array_count; ++
i)
1043 ior |= array_elements[array_base +
i];
1064 size_t array_i = array_base;
1069 for (
unsigned int shift = 0;
1071 shift += array_element_bits)
1072 word |= array_elements[array_i++] <<
shift;
1080 unsigned int word_i = 0;
1081 for (
unsigned int i = 0;
i < array_count; ++
i)
1082 for (
unsigned int shift = 0;
shift < array_element_bits;
1085 = array_elements[array_base +
i] >>
shift;
static int array_size
Definition bb-reorder.cc:174
bitmap bitmap_gc_alloc(ALONE_CXX_MEM_STAT_INFO)
unsigned long BITMAP_WORD
Definition bitmap.h:278
void bitmap_tree_view(bitmap)
Definition bitmap.cc:694
bool bitmap_ior_into(bitmap, const_bitmap)
Definition bitmap.cc:2114
void bitmap_obstack_free(bitmap)
Definition bitmap.cc:820
bool bitmap_equal_p(const_bitmap, const_bitmap)
Definition bitmap.cc:2347
void bitmap_obstack_release(bitmap_obstack *)
Definition bitmap.cc:758
void bitmap_initialize(bitmap head, bitmap_obstack *obstack CXX_MEM_STAT_INFO)
Definition bitmap.h:467
bool bitmap_single_bit_set_p(const_bitmap)
Definition bitmap.cc:1188
void bitmap_register(bitmap MEM_STAT_DECL)
void bitmap_copy(bitmap, const_bitmap)
Definition bitmap.cc:856
bitmap_obstack bitmap_default_obstack
Definition bitmap.cc:68
void bitmap_and(bitmap, const_bitmap, const_bitmap)
Definition bitmap.cc:1365
void bitmap_print(FILE *, const_bitmap, const char *, const char *)
Definition bitmap.cc:2807
mem_alloc_description< bitmap_usage > bitmap_mem_desc
Definition bitmap.cc:27
void debug_bitmap_file(FILE *, const_bitmap)
Definition bitmap.cc:2774
unsigned bitmap_clear_first_set_bit(bitmap)
Definition bitmap.cc:1306
void bitmap_obstack_initialize(bitmap_obstack *)
Definition bitmap.cc:733
unsigned bitmap_last_set_bit(const_bitmap)
Definition bitmap.cc:1315
void bitmap_release(bitmap head)
Definition bitmap.h:482
bool bmp_iter_and_compl(bitmap_iterator *bi, unsigned *bit_no)
Definition bitmap.h:850
void bmp_iter_next_bit(bitmap_iterator *bi, unsigned *bit_no)
Definition bitmap.h:712
bool bitmap_and_compl(bitmap, const_bitmap, const_bitmap)
Definition bitmap.cc:1520
bitmap_element bitmap_zero_bits
Definition bitmap.cc:67
void bitmap_clear(bitmap)
Definition bitmap.cc:713
void dump_bitmap(FILE *file, const_bitmap map)
Definition bitmap.h:498
void bitmap_list_view(bitmap)
Definition bitmap.cc:665
void bmp_iter_and_compl_init(bitmap_iterator *bi, const_bitmap map1, const_bitmap map2, unsigned start_bit, unsigned *bit_no)
Definition bitmap.h:652
void bitmap_xor_into(bitmap, const_bitmap)
Definition bitmap.cc:2285
bool bitmap_clear_bit(bitmap, int)
Definition bitmap.cc:919
void bitmap_clear_range(bitmap, unsigned int, unsigned int)
Definition bitmap.cc:1798
bool bitmap_empty_p(const_bitmap map)
Definition bitmap.h:393
bool bitmap_and_into(bitmap, const_bitmap)
Definition bitmap.cc:1425
void bitmap_xor(bitmap, const_bitmap, const_bitmap)
Definition bitmap.cc:2204
unsigned long bitmap_count_bits(const_bitmap)
Definition bitmap.cc:1136
bool bitmap_and_compl_into(bitmap, const_bitmap)
Definition bitmap.cc:1635
unsigned bitmap_first_set_bit(const_bitmap)
Definition bitmap.cc:1297
unsigned long bitmap_count_unique_bits(const_bitmap, const_bitmap)
Definition bitmap.cc:1151
void dump_bitmap_statistics(void)
Definition bitmap.cc:2846
hashval_t bitmap_hash(const_bitmap)
Definition bitmap.cc:2698
void bmp_iter_next(bitmap_iterator *bi, unsigned *bit_no)
Definition bitmap.h:703
void bitmap_move(bitmap, bitmap)
Definition bitmap.cc:896
bool bmp_iter_and(bitmap_iterator *bi, unsigned *bit_no)
Definition bitmap.h:781
BITMAP_WORD bitmap_get_aligned_chunk(const_bitmap, unsigned int, unsigned int)
Definition bitmap.cc:1059
void debug_bitmap(const_bitmap)
Definition bitmap.cc:2798
#define BITMAP_ELEMENT_WORDS
Definition bitmap.h:286
bitmap bitmap_alloc(bitmap_obstack *obstack CXX_MEM_STAT_INFO)
void bmp_iter_and_init(bitmap_iterator *bi, const_bitmap map1, const_bitmap map2, unsigned start_bit, unsigned *bit_no)
Definition bitmap.h:583
#define BITMAP_ELEMENT_ALL_BITS
Definition bitmap.h:291
bool bitmap_ior_into_and_free(bitmap, bitmap *)
Definition bitmap.cc:2155
void bitmap_set_aligned_chunk(bitmap, unsigned int, unsigned int, BITMAP_WORD)
Definition bitmap.cc:1015
bool bitmap_ior(bitmap, const_bitmap, const_bitmap)
Definition bitmap.cc:2064
bool bitmap_ior_and_compl_into(bitmap A, const_bitmap B, const_bitmap C)
Definition bitmap.cc:2540
void bmp_iter_set_init(bitmap_iterator *bi, const_bitmap map, unsigned start_bit, unsigned *bit_no)
Definition bitmap.h:539
bool bitmap_ior_and_compl(bitmap DST, const_bitmap A, const_bitmap B, const_bitmap C)
Definition bitmap.cc:2432
bool bmp_iter_set(bitmap_iterator *bi, unsigned *bit_no)
Definition bitmap.h:735
void bitmap_set_range(bitmap, unsigned int, unsigned int)
Definition bitmap.cc:1690
bool bitmap_ior_and_into(bitmap DST, const_bitmap B, const_bitmap C)
Definition bitmap.cc:2617
#define BITMAP_WORD_BITS
Definition bitmap.h:281
bool bitmap_intersect_p(const_bitmap, const_bitmap)
Definition bitmap.cc:2371
bool bitmap_intersect_compl_p(const_bitmap, const_bitmap)
Definition bitmap.cc:2401
void bitmap_compl_and_into(bitmap, const_bitmap)
Definition bitmap.cc:1933
bitmap_head m_bits
Definition bitmap.h:967
auto_bitmap(ALONE_CXX_MEM_STAT_INFO)
Definition bitmap.h:952
~auto_bitmap()
Definition bitmap.h:956
auto_bitmap(auto_bitmap &&)=delete
auto_bitmap & operator=(const auto_bitmap &)=delete
auto_bitmap(bitmap_obstack *o CXX_MEM_STAT_INFO)
Definition bitmap.h:954
auto_bitmap(const auto_bitmap &)=delete
Traits::element_type array_element_type
Definition bitmap.h:978
base_bitmap_view(const base_bitmap_view &)
bitmap_head m_head
Definition bitmap.h:986
base_bitmap_view(const T &, bitmap_element *)
Definition bitmap.h:1013
bitmap_element * first
Definition bitmap.h:347
CONSTEXPR bitmap_head()
Definition bitmap.h:332
unsigned * get_descriptor()
Definition bitmap.h:359
unsigned alloc_descriptor
Definition bitmap.h:344
unsigned int indx
Definition bitmap.h:337
unsigned tree_form
Definition bitmap.h:340
bitmap_obstack * obstack
Definition bitmap.h:351
bitmap_element * current
Definition bitmap.h:349
static bitmap_obstack crashme
Definition bitmap.h:330
void dump()
Definition bitmap.cc:2882
unsigned padding
Definition bitmap.h:342
static void dump_header(const char *name)
Definition bitmap.h:261
bitmap_usage(size_t allocated, size_t times, size_t peak, uint64_t nsearches, uint64_t search_iter)
Definition bitmap.h:224
void dump(mem_location *loc, const mem_usage &total) const
Definition bitmap.h:242
bitmap_usage()
Definition bitmap.h:222
uint64_t m_nsearches
Definition bitmap.h:268
bitmap_usage operator+(const bitmap_usage &second)
Definition bitmap.h:231
uint64_t m_search_iter
Definition bitmap.h:270
bitmap_view(const T &array)
Definition bitmap.h:996
Definition coretypes.h:181
Definition mem-stats.h:278
Definition mem-stats.h:35
char * to_string()
Definition mem-stats.h:93
bool m_ggc
Definition mem-stats.h:123
Definition mem-stats.h:128
size_t m_allocated
Definition mem-stats.h:253
size_t m_peak
Definition mem-stats.h:257
size_t m_times
Definition mem-stats.h:255
static float get_percent(size_t nominator, size_t denominator)
Definition mem-stats.h:230
bool debug
Definition collect-utils.cc:34
const class bitmap_head * const_bitmap
Definition coretypes.h:52
#define GTY(x)
Definition coretypes.h:41
class bitmap_head * bitmap
Definition coretypes.h:51
static struct string2counter_map map[debug_counter_number_of_counters]
Definition dbgcnt.cc:39
static struct obstack obstack
Definition gcc.cc:358
#define CHAR_BIT
Definition genautomata.cc:120
#define bitmap_bit_p(bitstring, bitno)
Definition genautomata.cc:3429
#define bitmap_set_bit(bitstring, bitno)
Definition genautomata.cc:3419
unsigned int shift
Definition ggc-page.cc:233
i
Definition poly-int.h:776
#define ALONE_CXX_MEM_STAT_INFO
Definition statistics.h:57
#define PASS_MEM_STAT
Definition statistics.h:54
#define MEM_STAT_DECL
Definition statistics.h:52
#define CXX_MEM_STAT_INFO
Definition statistics.h:58
struct bitmap_element * prev
Definition bitmap.h:318
unsigned int indx
Definition bitmap.h:320
struct bitmap_element * next
Definition bitmap.h:315
BITMAP_WORD bits[BITMAP_ELEMENT_WORDS]
Definition bitmap.h:322
BITMAP_WORD bits
Definition bitmap.h:532
bitmap_element * elt2
Definition bitmap.h:524
bitmap_element * elt1
Definition bitmap.h:521
unsigned word_no
Definition bitmap.h:527
struct obstack obstack
Definition bitmap.h:297
bitmap_head * heads
Definition bitmap.h:296
struct bitmap_element * elements
Definition bitmap.h:295
Definition collect2.cc:175
struct id * first
Definition collect2.cc:176
#define NULL
Definition system.h:50
#define gcc_assert(EXPR)
Definition system.h:821
#define CEIL(x, y)
Definition system.h:396
#define true
Definition system.h:894
#define false
Definition system.h:895
#define STATIC_CONSTANT_P(X)
Definition system.h:864
#define SIZE_AMOUNT(size)
Definition system.h:1290
#define MIN(X, Y)
Definition system.h:392
#define STATIC_ASSERT(X)
Definition system.h:871
#define PRsa(n)
Definition system.h:1294
#define gcc_checking_assert(EXPR)
Definition system.h:828