1 #ifndef MEMORY_LIMITER_CLASS
2 #define MEMORY_LIMITER_CLASS
25 class ml_memory_record;
26 class ml_memory_state_meter;
105 int _individual_limit;
107 ml_memory_state_meter *_individual_sizes;
109 ml_memory_record *find_individual(
int individual)
const;
Provides a dynamically resizable ASCII character string.
A simple object that wraps a templated set of ints.
Tracks memory currently in use by memory manager objects.
int individual_usage(int individual) const
returns the amount of memory used by "individual".
virtual ~memory_limiter()
memory_limiter(int overall_limit, int individual_limit)
creates a limiter that allows "overall_limit" bytes to be in use.
int overall_space_left() const
returns the overall space left for allocation.
DEFINE_CLASS_NAME("memory_limiter")
int overall_limit() const
returns the current overall limit.
bool okay_allocation(int individual, int memory_desired)
returns true if "individual" may allocate "memory_desired" bytes.
bool record_deletion(int individual, int memory_deleted)
acknowledges that the "individual" freed "memory_deleted" bytes.
int overall_usage() const
returns the size used by all managed memory.
int individual_limit() const
returns the current individual limit.
const structures::int_set & individuals_listed() const
reports the current set of individuals using memory.
basis::astring text_form(int indent=0) const
returns a string that lists out the overall plus individual limits.
int individual_space_left(int individual) const
returns the space left for the individual specified.
void reset()
returns the object to a pristine state.
A dynamic container class that holds any kind of object via pointers.