This fixes accounting issues with using auto_vec and auto_bitmap
for -fmem-report.
2021-02-01 Richard Biener <rguenther@suse.de>
* vec.h (auto_vec::auto_vec): Add memory stat parameters
and pass them on.
* bitmap.h (auto_bitmap::auto_bitmap): Likewise.
class auto_bitmap
{
public:
- auto_bitmap () { bitmap_initialize (&m_bits, &bitmap_default_obstack); }
- explicit auto_bitmap (bitmap_obstack *o) { bitmap_initialize (&m_bits, o); }
+ auto_bitmap (ALONE_CXX_MEM_STAT_INFO)
+ { bitmap_initialize (&m_bits, &bitmap_default_obstack PASS_MEM_STAT); }
+ explicit auto_bitmap (bitmap_obstack *o CXX_MEM_STAT_INFO)
+ { bitmap_initialize (&m_bits, o PASS_MEM_STAT); }
~auto_bitmap () { bitmap_clear (&m_bits); }
// Allow calling bitmap functions on our bitmap.
operator bitmap () { return &m_bits; }
this->m_vec = &m_auto;
}
- auto_vec (size_t s)
+ auto_vec (size_t s CXX_MEM_STAT_INFO)
{
if (s > N)
{
- this->create (s);
+ this->create (s PASS_MEM_STAT);
return;
}
{
public:
auto_vec () { this->m_vec = NULL; }
- auto_vec (size_t n) { this->create (n); }
+ auto_vec (size_t n CXX_MEM_STAT_INFO) { this->create (n PASS_MEM_STAT); }
~auto_vec () { this->release (); }
auto_vec (vec<T, va_heap>&& r)