25 #include "precompiled.hpp" |
25 #include "precompiled.hpp" |
26 #include "utilities/intHisto.hpp" |
26 #include "utilities/intHisto.hpp" |
27 |
27 |
28 IntHistogram::IntHistogram(int est, int max) : _max(max), _tot(0) { |
28 IntHistogram::IntHistogram(int est, int max) : _max(max), _tot(0) { |
29 assert(0 <= est && est <= max, "Preconditions"); |
29 assert(0 <= est && est <= max, "Preconditions"); |
30 _elements = new (ResourceObj::C_HEAP) GrowableArray<int>(est, true); |
30 _elements = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<int>(est, true); |
31 guarantee(_elements != NULL, "alloc failure"); |
31 guarantee(_elements != NULL, "alloc failure"); |
32 } |
32 } |
33 |
33 |
34 void IntHistogram::add_entry(int outcome) { |
34 void IntHistogram::add_entry(int outcome) { |
35 if (outcome > _max) outcome = _max; |
35 if (outcome > _max) outcome = _max; |