diff options
Diffstat (limited to 'src/mem/ruby/common')
-rw-r--r-- | src/mem/ruby/common/Histogram.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mem/ruby/common/Histogram.cc b/src/mem/ruby/common/Histogram.cc index 0558e5198..e377bc253 100644 --- a/src/mem/ruby/common/Histogram.cc +++ b/src/mem/ruby/common/Histogram.cc @@ -124,7 +124,12 @@ Histogram::add(Histogram& hist) uint32_t t_bins = m_data.size(); if (hist.getBins() != t_bins) { - fatal("Histograms with different number of bins cannot be combined!"); + if (m_count == 0) { + m_data.resize(hist.getBins()); + } else { + fatal("Histograms with different number of bins " + "cannot be combined!"); + } } m_max = max(m_max, hist.getMax()); |