BAM
Abstract Machine for Bottom-Up Evaluation with the Push Method
Public Member Functions | Static Public Member Functions | List of all members
mpool_c Class Reference

#include <mpool.h>

Public Member Functions

 mpool_c (str_t name)
 
page_t alloc_page ()
 
mpool_cnext_pool () const
 
str_t name () const
 
int num_alloc_pages () const
 
void dump (str_t headline=STR_NULL) const
 

Static Public Member Functions

static mpool_cfirst_pool ()
 

Detailed Description

Memory pool: Keeps track of allocated memory pages.

The main function of a memory pool is that it permits to allocate memory pages. It keeps track of the allocated memory pages. These memory pages will be deallocated in the destructor.

A memory pool is typically used in relation data structures and other data structures which need memory pages. If there is a local variable of the relation type in the program, and this is destroyed because the function returns, then all memory pages allocated by the relation will be automatically freed.

This class also manages a linked list of all existing objects (memory pools). This can be used for printing memory statistics. Therefore, it is necessary that memory pools have names (typically the name of the relation).


The documentation for this class was generated from the following files: