/* Functions to support a pool of allocatable objects
- Copyright (C) 1997-2018 Free Software Foundation, Inc.
+ Copyright (C) 1997-2020 Free Software Foundation, Inc.
Contributed by Daniel Berlin <dan@cgsoftware.com>
This file is part of GCC.
extern ALLOC_POOL_ID_TYPE last_id;
/* Pool allocator memory usage. */
-struct pool_usage: public mem_usage
+class pool_usage: public mem_usage
{
+public:
/* Default contructor. */
pool_usage (): m_element_size (0), m_pool_name ("") {}
/* Constructor. */
/* Dump usage coupled to LOC location, where TOTAL is sum of all rows. */
inline void
- dump (mem_location *loc, mem_usage &total) const
+ dump (mem_location *loc, const mem_usage &total) const
{
char *location_string = loc->to_string ();
{
fprintf (stderr, "%-32s%-48s %6s%11s%16s%17s%12s\n", "Pool name", name,
"Pools", "Leak", "Peak", "Times", "Elt size");
- print_dash_line ();
}
/* Dump footer. */
inline void
dump_footer ()
{
- print_dash_line ();
fprintf (stderr, "%s" PRsa(82) PRsa(10) "\n", "Total",
SIZE_AMOUNT (m_instances), SIZE_AMOUNT (m_allocated));
- print_dash_line ();
}
/* Element size. */