Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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
titleNote

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

NameDescription
Geo::s32 TIndexer

The indexing type for the pool.

Functions

NameDescription
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.


Anchor
a5fbb603ec2508e9b134241138bc30b76
a5fbb603ec2508e9b134241138bc30b76

void* Geo::GeoAllocationPage::Allocate

...

public: void * Allocate()

...

Assign a slot in this pool, and return a pointer to it.


Anchor
ae5e18fc555fdc5897c65cb7eee41b1a1
ae5e18fc555fdc5897c65cb7eee41b1a1

bool Geo::GeoAllocationPage::Create

...

public: bool Create
(
    size_t objectSize,
    TIndexer maxObjects
)

...

Create a pool big enough to hold maxObjects, of size objectSize.


Anchor
a5739a03d0b1efc63088eaa7856e1bc80
a5739a03d0b1efc63088eaa7856e1bc80

void Geo::GeoAllocationPage::Deallocate

...

public: void Deallocate
(
    void * pStorage
)

...

Release a single slot back to the pool.


Anchor
a1adb3a6b98956187f0f71d3b2819f2c9
a1adb3a6b98956187f0f71d3b2819f2c9

void Geo::GeoAllocationPage::Destroy

...

public: void Destroy()

...

Free the contents of the pool.


Anchor
a184eb27caa088c4e868afe88600416e0
a184eb27caa088c4e868afe88600416e0

TIndexer Geo::GeoAllocationPage::MaxObjects

...

public: TIndexer MaxObjects() const

...

Returns maximum number of objects that can be held.