|
ADS
Algorithms and Data Structures
|
The dynamic storage allocation of Knuth, beyond the book, on a memory of \( N \) words simulated by a vector, so that the blocks and their headers can be inspected: More...
#include "ADS/Contract.h"#include <cstddef>#include <limits>#include <map>#include <set>#include <vector>#include "ADS/memory/impl/Allocators.tpp"Go to the source code of this file.
Classes | |
| class | ADS::BoundaryTagAllocator |
| the dynamic storage allocation with boundary tags More... | |
| class | ADS::BuddyAllocator |
| the buddy system on \( 2^m \) words More... | |
Namespaces | |
| namespace | ADS |
The dynamic storage allocation of Knuth, beyond the book, on a memory of \( N \) words simulated by a vector, so that the blocks and their headers can be inspected:
Both return the address of the first word of the block given, or \( -1 \) if no block fits. The contracts [see Contract.h]: a request is positive, and free() gets an address that allocate() gave and that is in use; the invariants (the free blocks tile the free memory, never adjacent ones for the boundary tags, never two free buddies) are audits. The operations are defined in Allocators.tpp.