Go to the documentation of this file.
18 #ifndef __LIBALLOC_BITALLOCATOR_H
19 #define __LIBALLOC_BITALLOCATOR_H
Result allocateFrom(Range &args, const Size startBit)
Allocate memory from defined starting address.
Size chunkSize() const
Get chunk size.
bool isAllocated(const Address page) const
Check if a chunk is allocated.
Result allocateAt(const Address addr)
Allocate a specific address.
unsigned long Address
A memory address.
virtual Size available() const
Get available memory.
BitArray m_array
Marks which chunks are (un)used.
virtual Result release(const Address chunk)
Release memory chunk.
Size m_lastBit
Last bit that was set.
unsigned int Size
Any sane size indicator cannot go negative.
Describes a range of memory.
BitAllocator(const Range range, const Size chunkSize, u8 *bitmap=ZERO)
Constructor function.
unsigned char u8
Unsigned 8-bit number.
virtual Result allocate(Range &args)
Allocate memory.
const Size m_chunkSize
Size of each chunk.
Represents an array of bits.
Result
Allocation results.