class Geo::GeoAllocationPage
A storage unit for a page based allocation system.
Despite looking like a std::allocator, you cannot fully implement an allocator using this kind of class alone (as allocators do not have state, and clearly, a page has state). As a result, this class is used by the GeoFixedPoolAllocator class, which is a std::allocator.
Note | ||
---|---|---|
| ||
This class knows nothing of the types of object that it may be storing, it is just raw memory. Hence no constructors or destructors are called, that is the responsibility of the allocator. |
Typedefs
Name | Description |
---|---|
Geo::s32 TIndexer | The indexing type for the pool. |
Functions
Name | Description |
---|---|
Allocate() | Assign a slot in this pool, and return a pointer to it. |
Create(size_t, TIndexer) | Create a pool big enough to hold maxObjects, of size objectSize. |
Deallocate(void *) | Release a single slot back to the pool. |
Destroy() | Free the contents of the pool. |
MaxObjects() | Returns maximum number of objects that can be held. |
NonCopyable(NonCopyable &&) | Defaulted to allow move. |
operator=(NonCopyable &&) | Defaulted to allow move. |
Anchor | ||||
---|---|---|---|---|
|
void* Geo::GeoAllocationPage::Allocate
...
public: void * Allocate()
...
Assign a slot in this pool, and return a pointer to it.
Anchor | ||||
---|---|---|---|---|
|
bool Geo::GeoAllocationPage::Create
...
public: bool Create
(
size_t objectSize,
TIndexer maxObjects
)
...
Create a pool big enough to hold maxObjects, of size objectSize.
Anchor | ||||
---|---|---|---|---|
|
void Geo::GeoAllocationPage::Deallocate
...
public: void Deallocate
(
void * pStorage
)
...
Release a single slot back to the pool.
Anchor | ||||
---|---|---|---|---|
|
void Geo::GeoAllocationPage::Destroy
...
public: void Destroy()
...
Free the contents of the pool.
Anchor | ||||
---|---|---|---|---|
|
TIndexer Geo::GeoAllocationPage::MaxObjects
...
public: TIndexer MaxObjects() const
...
Returns maximum number of objects that can be held.
Anchor | ||||
---|---|---|---|---|
|
Geo::NonCopyable::NonCopyable
...
public: NonCopyable
(
NonCopyable &&
)
...
Defaulted to allow move.
Anchor | ||||
---|---|---|---|---|
|
NonCopyable& Geo::NonCopyable::operator=
...
public: NonCopyable & operator=
(
NonCopyable &&
)
...
Defaulted to allow move.