FreeNOS
Public Member Functions | Data Fields
PoolAllocator::Pool Struct Reference

Allocates same-sized objects from a contiguous block of memory. More...

Inheritance diagram for PoolAllocator::Pool:
BitAllocator Allocator

Public Member Functions

 Pool (const Range &range, const Size objectSize, const Size bitmapSize, u8 *bitmap)
 
- Public Member Functions inherited from BitAllocator
 BitAllocator (const Range range, const Size chunkSize, u8 *bitmap=ZERO)
 Constructor function. More...
 
Size chunkSize () const
 Get chunk size. More...
 
virtual Size available () const
 Get available memory. More...
 
virtual Result allocate (Range &args)
 Allocate memory. More...
 
Result allocateFrom (Range &args, const Size startBit)
 Allocate memory from defined starting address. More...
 
Result allocateAt (const Address addr)
 Allocate a specific address. More...
 
bool isAllocated (const Address page) const
 Check if a chunk is allocated. More...
 
virtual Result release (const Address chunk)
 Release memory chunk. More...
 
- Public Member Functions inherited from Allocator
 Allocator ()
 Default class constructor. More...
 
 Allocator (const Range range)
 Class constructor with Range input. More...
 
virtual ~Allocator ()
 Class destructor. More...
 
void setParent (Allocator *parent)
 Set parent allocator. More...
 
Allocatorparent ()
 Get parent Allocator. More...
 
Address base () const
 Get memory base address for allocations. More...
 
Size alignment () const
 Get memory alignment in bytes for allocations. More...
 
virtual Size size () const
 Get memory size. More...
 

Data Fields

Poolprev
 Points to the previous pool of this size (if any). More...
 
Poolnext
 Points to the next pool of this size (if any). More...
 
Size index
 Index number in the m_pools array where this Pool is stored. More...
 
const Size bitmapSize
 Size in bytes of the bitmap array. More...
 

Additional Inherited Members

- Public Types inherited from Allocator
enum  Result {
  Success = 0, InvalidAddress, InvalidSize, InvalidAlignment,
  OutOfMemory
}
 Allocation results. More...
 
typedef struct Allocator::Range Range
 Describes a range of memory. More...
 
- Static Public Member Functions inherited from Allocator
static void setDefault (Allocator *alloc)
 Makes the given Allocator the default. More...
 
static AllocatorgetDefault ()
 Retrieve the currently default Allocator. More...
 
- Protected Member Functions inherited from Allocator
Address aligned (const Address addr, const Size boundary) const
 Align memory address. More...
 

Detailed Description

Allocates same-sized objects from a contiguous block of memory.

Definition at line 61 of file PoolAllocator.h.

Constructor & Destructor Documentation

◆ Pool()

PoolAllocator::Pool::Pool ( const Range range,
const Size  objectSize,
const Size  bitmapSize,
u8 bitmap 
)
inline

Definition at line 63 of file PoolAllocator.h.

Field Documentation

◆ bitmapSize

const Size PoolAllocator::Pool::bitmapSize

Size in bytes of the bitmap array.

Definition at line 78 of file PoolAllocator.h.

◆ index

Size PoolAllocator::Pool::index

Index number in the m_pools array where this Pool is stored.

Definition at line 77 of file PoolAllocator.h.

Referenced by PoolAllocator::allocatePool(), and PoolAllocator::releasePool().

◆ next

Pool* PoolAllocator::Pool::next

Points to the next pool of this size (if any).

Definition at line 76 of file PoolAllocator.h.

Referenced by PoolAllocator::allocatePool(), PoolAllocator::releasePool(), and PoolAllocator::retrievePool().

◆ prev

Pool* PoolAllocator::Pool::prev

Points to the previous pool of this size (if any).

Definition at line 75 of file PoolAllocator.h.

Referenced by PoolAllocator::allocatePool(), and PoolAllocator::releasePool().


The documentation for this struct was generated from the following file: