Go to the documentation of this file.
99 corrected += boundary - (addr % boundary);
static void * set(void *dest, int ch, unsigned count)
Fill memory with a constant byte.
Allocator * m_parent
Our parent Allocator, if any.
unsigned long Address
A memory address.
Address address
Starting address of the memory range.
Size alignment
Alignment in bytes or ZERO for default alignment.
virtual ~Allocator()
Class destructor.
Size size
Amount of memory in bytes.
Allocator * parent()
Get parent Allocator.
virtual Result allocate(Range &range)
Allocate memory.
unsigned int u32
Unsigned 32-bit number.
unsigned int Size
Any sane size indicator cannot go negative.
virtual Size size() const
Get memory size.
virtual Size available() const
Get memory available.
static Allocator * getDefault()
Retrieve the currently default Allocator.
Address base() const
Get memory base address for allocations.
Size alignment() const
Get memory alignment in bytes for allocations.
Describes a range of memory.
static void setDefault(Allocator *alloc)
Makes the given Allocator the default.
#define assert(exp)
Insert program diagnostics.
virtual Result release(const Address addr)
Release memory.
Allocator()
Default class constructor.
Range m_range
Range of memory that this Allocator manages.
void setParent(Allocator *parent)
Set parent allocator.
static Allocator * m_default
Points to the default Allocator for new()/delete().
Result
Allocation results.
Address aligned(const Address addr, const Size boundary) const
Align memory address.