Versions Compared

Key

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

template<class T>
class Geo::GeoMemoryPool

A memory pool.

Variables

NameDescription
const u32 MemoryAlignment = GEO_ALIGN_OF(T) > GEO_ALIGN_OF(Geo::u32) ? GEO_ALIGN_OF(T) : GEO_ALIGN_OF(Geo::u32)

The required memory alignment.

Functions

NameDescription
Allocate()

Allocate object.

AllocateIndex()

Returns the index of a newly allocated object within the pool.

CalculateSize(Geo::u32)

Calculate required memory size.

Deallocate(T *)

Deallocate object.

DeallocateIndex(Geo::u32)

Deallocates the object at the specified index within the pool.

GeoMemoryPool(void *, Geo::u32)

Create a memory pool.

GetIndex(const T *)

Returns the index of the specified object within the pool.

GetObject(Geo::u32)

Returns the object at the specified index within the pool.

IsEmpty()

Returns true if no more blocks can be allocated.


Anchor
a3709c6f2adcc80f52df55c0cea0f93ed
a3709c6f2adcc80f52df55c0cea0f93ed

T* Geo::GeoMemoryPool< T >::Allocate

...

public: T * Allocate()

...

Allocate object.


Anchor
a4dfbc491a52746f55761bdf02eeae5c8
a4dfbc491a52746f55761bdf02eeae5c8

Geo::u32 Geo::GeoMemoryPool< T >::AllocateIndex

...

public: Geo::u32 AllocateIndex()

...

Returns the index of a newly allocated object within the pool.


Anchor
a9640ab139a5e2d6de924f91505f0aad7
a9640ab139a5e2d6de924f91505f0aad7

static Geo::u32 Geo::GeoMemoryPool< T >::CalculateSize

...

public: Geo::u32 CalculateSize
(
    Geo::u32 count
)

...

Calculate required memory size.

Parameters
[in]count

The maximum number of objects the memory pool can allocate.


Anchor
a8c0a2705d1a2b2e23679da3750ccde4b
a8c0a2705d1a2b2e23679da3750ccde4b

void Geo::GeoMemoryPool< T >::Deallocate

...

public: void Deallocate
(
    T * ptr
)

...

Deallocate object.


Anchor
ab29a206e80e5f4f1c3c581b901298acc
ab29a206e80e5f4f1c3c581b901298acc

void Geo::GeoMemoryPool< T >::DeallocateIndex

...

public: void DeallocateIndex
(
    Geo::u32 index
)

...

Deallocates the object at the specified index within the pool.


Anchor
a8ee13102f11269d5632237feddbc629f
a8ee13102f11269d5632237feddbc629f

Geo::GeoMemoryPool< T >::GeoMemoryPool

...

public: GeoMemoryPool
(
    void * memory,
    Geo::u32 count
)

...

Create a memory pool.

Parameters
[in]memory

The start of the allocated memory space.

[in]count

The maximum number of objects the memory pool can allocate.


Anchor
a3d02ff471c68fafbc1c6381a0cd66a14
a3d02ff471c68fafbc1c6381a0cd66a14

Geo::u32 Geo::GeoMemoryPool< T >::GetIndex

...

public: Geo::u32 GetIndex
(
    const T * ptr
) const

...

Returns the index of the specified object within the pool.


Anchor
a578c09c52057979b7a250d7d590471ab
a578c09c52057979b7a250d7d590471ab

T* Geo::GeoMemoryPool< T >::GetObject

...

public: T * GetObject
(
    Geo::u32 index
) const

...

Returns the object at the specified index within the pool.


Anchor
a0364d54d0e959d32976179501c2c39d1
a0364d54d0e959d32976179501c2c39d1

bool Geo::GeoMemoryPool< T >::IsEmpty

...

public: bool IsEmpty() const

...

Returns true if no more blocks can be allocated.