File Arena.h
↰ Parent directory (ADS/memory)
An arena of objects allocated in blocks, beyond the book: make() builds an object in the current block, a new block of n objects is taken when it is full, and all the objects die with the arena.
Definition (ADS/memory/Arena.h)
Detailed Description
Allocating costs a pointer bump instead of a call to the allocator, the objects made one after another are next to each other in memory, and their addresses never change, which the pointers among them (the parents of the nodes of a search) rely on; the price is that an object cannot be freed by itself. The blocks come from the allocator A, which may give, e.g., huge pages.
The contracts [see File Contract.h]: a block holds at least one object; the invariant is that size() objects have been made. The operations are defined in Arena.tpp.
Hanson, Fast allocation and deallocation of memory based on object lifetimes, Software: Practice and Experience 20(1), 5-12, 1990, doi:10.1002/spe.4380200104
- Donato Meoli
Dipartimento di Informatica Universita’ di Pisa
by Donato Meoli
Includes
ADS/Contract.h(File Contract.h)ADS/memory/impl/Arena.tppcomparecstddefiteratormemory(File Allocators.h)newtype_traitsutilityvector