Mercurial > hg > CbC > CbC_gcc
diff gcc/mem-stats.h @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
line wrap: on
line diff
--- a/gcc/mem-stats.h Fri Oct 27 22:46:09 2017 +0900 +++ b/gcc/mem-stats.h Thu Oct 25 07:37:49 2018 +0900 @@ -1,5 +1,5 @@ /* A memory statistics tracking infrastructure. - Copyright (C) 2015-2017 Free Software Foundation, Inc. + Copyright (C) 2015-2018 Free Software Foundation, Inc. Contributed by Martin Liska <mliska@suse.cz> This file is part of GCC. @@ -163,10 +163,22 @@ m_instances + second.m_instances); } + /* Equality operator. */ + inline bool + operator== (const mem_usage &second) const + { + return (m_allocated == second.m_allocated + && m_peak == second.m_peak + && m_times == second.m_times); + } + /* Comparison operator. */ inline bool operator< (const mem_usage &second) const { + if (*this == second) + return false; + return (m_allocated == second.m_allocated ? (m_peak == second.m_peak ? m_times < second.m_times : m_peak < second.m_peak) : m_allocated < second.m_allocated); @@ -181,7 +193,10 @@ const mem_pair_t f = *(const mem_pair_t *)first; const mem_pair_t s = *(const mem_pair_t *)second; - return (*f.second) < (*s.second); + if (*f.second == *s.second) + return 0; + + return *f.second < *s.second ? 1 : -1; } /* Dump usage coupled to LOC location, where TOTAL is sum of all rows. */