diff options
author | marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-06-03 14:49:13 +0000 |
---|---|---|
committer | marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-06-03 14:49:13 +0000 |
commit | 94302dfa934c612eccbc19359cd825bd52c21aa6 (patch) | |
tree | 6099942cfb1d37ffb58443756cd0f685b1cfd9f8 /gcc/ggc-common.c | |
parent | f29929b504428aa8bf6c476c67a98169b8985d60 (diff) | |
download | gcc-94302dfa934c612eccbc19359cd825bd52c21aa6.tar.gz |
Fix GNU coding style in memory statistics.
* alloc-pool.h (struct pool_usage): Correct GNU coding style.
* bitmap.h (struct bitmap_usage): Likewise.
* ggc-common.c (struct ggc_usage): Likewise.
* mem-stats.h (struct mem_location): Likewise.
(struct mem_usage): Likewise.
* vec.c (struct vec_usage): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224082 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ggc-common.c')
-rw-r--r-- | gcc/ggc-common.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c index 43ccc0b7402..cd81770bedf 100644 --- a/gcc/ggc-common.c +++ b/gcc/ggc-common.c @@ -843,7 +843,8 @@ struct ggc_usage: public mem_usage m_freed (freed), m_collected (collected), m_overhead (overhead) {} /* Comparison operator. */ - inline bool operator< (const ggc_usage &second) const + inline bool + operator< (const ggc_usage &second) const { return (get_balance () == second.get_balance () ? (m_peak == second.m_peak ? m_times < second.m_times @@ -852,7 +853,8 @@ struct ggc_usage: public mem_usage } /* Register overhead of ALLOCATED and OVERHEAD bytes. */ - inline void register_overhead (size_t allocated, size_t overhead) + inline void + register_overhead (size_t allocated, size_t overhead) { m_allocated += allocated; m_overhead += overhead; @@ -860,13 +862,15 @@ struct ggc_usage: public mem_usage } /* Release overhead of SIZE bytes. */ - inline void release_overhead (size_t size) + inline void + release_overhead (size_t size) { m_freed += size; } /* Sum the usage with SECOND usage. */ - ggc_usage operator+ (const ggc_usage &second) + ggc_usage + operator+ (const ggc_usage &second) { return ggc_usage (m_allocated + second.m_allocated, m_times + second.m_times, @@ -877,7 +881,8 @@ struct ggc_usage: public mem_usage } /* Dump usage with PREFIX, where TOTAL is sum of all rows. */ - inline void dump (const char *prefix, ggc_usage &total) const + inline void + dump (const char *prefix, ggc_usage &total) const { long balance = get_balance (); fprintf (stderr, @@ -892,7 +897,8 @@ struct ggc_usage: public mem_usage } /* Dump usage coupled to LOC location, where TOTAL is sum of all rows. */ - inline void dump (mem_location *loc, ggc_usage &total) const + inline void + dump (mem_location *loc, ggc_usage &total) const { char *location_string = loc->to_string (); @@ -902,7 +908,8 @@ struct ggc_usage: public mem_usage } /* Dump footer. */ - inline void dump_footer () + inline void + dump_footer () { print_dash_line (); dump ("Total", *this); @@ -910,7 +917,8 @@ struct ggc_usage: public mem_usage } /* Get balance which is GGC allocation leak. */ - inline long get_balance () const + inline long + get_balance () const { return m_allocated + m_overhead - m_collected - m_freed; } @@ -918,7 +926,8 @@ struct ggc_usage: public mem_usage typedef std::pair<mem_location *, ggc_usage *> mem_pair_t; /* Compare wrapper used by qsort method. */ - static int compare (const void *first, const void *second) + static int + compare (const void *first, const void *second) { const mem_pair_t f = *(const mem_pair_t *)first; const mem_pair_t s = *(const mem_pair_t *)second; @@ -927,8 +936,10 @@ struct ggc_usage: public mem_usage } /* Compare rows in final GGC summary dump. */ - static int compare_final (const void *first, const void *second) - { typedef std::pair<mem_location *, ggc_usage *> mem_pair_t; + static int + compare_final (const void *first, const void *second) + { + typedef std::pair<mem_location *, ggc_usage *> mem_pair_t; const ggc_usage *f = ((const mem_pair_t *)first)->second; const ggc_usage *s = ((const mem_pair_t *)second)->second; @@ -940,7 +951,8 @@ struct ggc_usage: public mem_usage } /* Dump header with NAME. */ - static inline void dump_header (const char *name) + static inline void + dump_header (const char *name) { fprintf (stderr, "%-48s %11s%17s%17s%16s%17s\n", name, "Garbage", "Freed", "Leak", "Overhead", "Times"); |