Versions Compared

Key

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

class Geo::GeoMemoryDefault

    └>Geo::MemoryAllocator

Fully featured MemoryAllocator implementation that handles memory tracking, leak detection, stack traces, reporting and more.

Passes actual allocation requests to another allocator (such as AnsiAllocator).

Functions

NameDescription
~MemoryAllocator()

Force a virtual destructor. This is not called by GeoMemory.

Allocate(size_t, size_t, const char *, Geo::s32, const char *)

Allocate a block of memory with the given size.

Allocate(size_t, size_t, const char *, Geo::s32, const char *)

Allocate a block of memory with the given size.

Free(void *, bool, const char *, Geo::s32, const char *)

Free a block of memory, possibly aligned.

Free(void *, bool, const char *, Geo::s32, const char *)

Free a block of memory, possibly aligned.

GeoMemoryDefault(MemoryAllocator *, bool)

Initialise object, allowing for replacement of the allocator that does the actual work.

GetTotalMemoryAllocated()

The total amount of memory we've allocated to date (not subtracting deallocations).

GetTotalMemoryAllocated()

The total amount of memory we've allocated to date (not subtracting deallocations).

GetTotalMemoryAllocationCalls()

The number of times we've allocated memory through GeoMemory.

GetTotalMemoryAllocationCalls()

The number of times we've allocated memory through GeoMemory.

GetTotalMemoryDeallocated()

The total amount of memory we've deallocated so far.

GetTotalMemoryDeallocated()

The total amount of memory we've deallocated so far.

GetTotalMemoryInUse()

The total amount of memory currently allocated (allocations minus deallocations)

GetTotalMemoryInUse()

The total amount of memory currently allocated (allocations minus deallocations)

IsTotalMemorySummarySupported()

Returns true if the memory summary functionality is supported with this allocator.

IsTotalMemorySummarySupported()

Returns true if the memory summary functionality is supported with this allocator.

Realloc(void *, size_t, size_t, const char *, s32, const char *)

Reallocate a block of memory, preserving as much data as will fit in the new block size.

Realloc(void *, size_t, size_t, const char *, s32, const char *)

Reallocate a block of memory, preserving as much data as will fit in the new block size.

SetMaximumHeapSize(Geo::u64)

Sets the maximum amount of memory that is allowed to be allocated. Allocations after this size has been reached will return NULL.


Anchor
a7acf643b8e4a54ca5884d64c2a8233c8
a7acf643b8e4a54ca5884d64c2a8233c8

virtual Geo::MemoryAllocator::~MemoryAllocator

...

public: virtual ~MemoryAllocator()

...

Force a virtual destructor. This is not called by GeoMemory.


Anchor
af23a6f348b86487ab29993048809cac3
af23a6f348b86487ab29993048809cac3

virtual void* Geo::GeoMemoryDefault::Allocate

...

public: virtual void * Allocate
(
    size_t size,
    size_t align,
    const char * filename,
    Geo::s32 lineNumber,
    const char * message
)

...

Allocate a block of memory with the given size.

If alignment is 0, use unaligned allocation. Otherwise, alignment must be a power of two.


Anchor
a1ad7d61101838a39ceed4f6e26544f5a
a1ad7d61101838a39ceed4f6e26544f5a

virtual void* Geo::MemoryAllocator::Allocate

...

public: void * Allocate
(
    size_t size,
    size_t align,
    const char * filename,
    Geo::s32 lineNumber,
    const char * message
)

...

Allocate a block of memory with the given size.

If alignment is 0, use unaligned allocation. Otherwise, alignment must be a power of two.


Anchor
a262dc6f22003daa8e8f7b18198d8142d
a262dc6f22003daa8e8f7b18198d8142d

virtual void Geo::GeoMemoryDefault::Free

...

public: virtual void Free
(
    void * mem,
    bool aligned,
    const char * filename,
    Geo::s32 lineNumber,
    const char * message
)

...

Free a block of memory, possibly aligned.


Anchor
a0fc025f53e6435fec6b7589083aebbb6
a0fc025f53e6435fec6b7589083aebbb6

virtual void Geo::MemoryAllocator::Free

...

public: void Free
(
    void * mem,
    bool aligned,
    const char * filename,
    Geo::s32 lineNumber,
    const char * message
)

...

Free a block of memory, possibly aligned.


Anchor
aa3842e2c97b278f359f3a99abb04aed1
aa3842e2c97b278f359f3a99abb04aed1

Geo::GeoMemoryDefault::GeoMemoryDefault

...

public: GeoMemoryDefault
(
    MemoryAllocator * customAlloc,
    bool failureIsFatal
)

...

Initialise object, allowing for replacement of the allocator that does the actual work.

When failureIsFatal is true, the allocator will stop the program on allocation failure.


Anchor
a63231c28aa6a366e15b701344d408487
a63231c28aa6a366e15b701344d408487

virtual s64 Geo::GeoMemoryDefault::GetTotalMemoryAllocated

...

public: virtual s64 GetTotalMemoryAllocated()

...

The total amount of memory we've allocated to date (not subtracting deallocations).


Anchor
a8d1f225f2ebcde9415cb3fa3e53d66d6
a8d1f225f2ebcde9415cb3fa3e53d66d6

virtual Geo::s64 Geo::MemoryAllocator::GetTotalMemoryAllocated

...

public: virtual Geo::s64 GetTotalMemoryAllocated()

...

The total amount of memory we've allocated to date (not subtracting deallocations).


Anchor
a4ccfc05b4859f92e48731d41055ba939
a4ccfc05b4859f92e48731d41055ba939

virtual s64 Geo::GeoMemoryDefault::GetTotalMemoryAllocationCalls

...

public: virtual s64 GetTotalMemoryAllocationCalls()

...

The number of times we've allocated memory through GeoMemory.


Anchor
ae599af57b73a23ee1d2883a202178bc4
ae599af57b73a23ee1d2883a202178bc4

virtual Geo::s64 Geo::MemoryAllocator::GetTotalMemoryAllocationCalls

...

public: virtual Geo::s64 GetTotalMemoryAllocationCalls()

...

The number of times we've allocated memory through GeoMemory.


Anchor
a93d0713897ac9f750a20ca635e8791fb
a93d0713897ac9f750a20ca635e8791fb

virtual s64 Geo::GeoMemoryDefault::GetTotalMemoryDeallocated

...

public: virtual s64 GetTotalMemoryDeallocated()

...

The total amount of memory we've deallocated so far.


Anchor
a6c4a211d30c4600a93b22d84a78c01b3
a6c4a211d30c4600a93b22d84a78c01b3

virtual Geo::s64 Geo::MemoryAllocator::GetTotalMemoryDeallocated

...

public: virtual Geo::s64 GetTotalMemoryDeallocated()

...

The total amount of memory we've deallocated so far.


Anchor
a6171a383de6d407b70c9f2155500edfc
a6171a383de6d407b70c9f2155500edfc

virtual s64 Geo::GeoMemoryDefault::GetTotalMemoryInUse

...

public: virtual s64 GetTotalMemoryInUse()

...

The total amount of memory currently allocated (allocations minus deallocations)


Anchor
a94fcfab1a68e8e593eaa8c7d30301639
a94fcfab1a68e8e593eaa8c7d30301639

virtual Geo::s64 Geo::MemoryAllocator::GetTotalMemoryInUse

...

public: virtual Geo::s64 GetTotalMemoryInUse()

...

The total amount of memory currently allocated (allocations minus deallocations)


Anchor
a0e38113ec1ee30e063491f8d5fe8479f
a0e38113ec1ee30e063491f8d5fe8479f

virtual bool Geo::GeoMemoryDefault::IsTotalMemorySummarySupported

...

public: virtual bool IsTotalMemorySummarySupported()

...

Returns true if the memory summary functionality is supported with this allocator.


Anchor
a3fddad784ad8df094175215b0e74d259
a3fddad784ad8df094175215b0e74d259

virtual bool Geo::MemoryAllocator::IsTotalMemorySummarySupported

...

public: virtual bool IsTotalMemorySummarySupported()

...

Returns true if the memory summary functionality is supported with this allocator.


Anchor
a5e7edc1e44ef98a103e58bd0367dba12
a5e7edc1e44ef98a103e58bd0367dba12

virtual void* Geo::MemoryAllocator::Realloc

...

public: void * Realloc
(
    void * mem,
    size_t size,
    size_t align,
    const char * filename,
    s32 lineNumber,
    const char * message
)

...

Reallocate a block of memory, preserving as much data as will fit in the new block size.

Requires the same alignment as in the original allocation.


Anchor
a853b969448cb10371029a145a2357573
a853b969448cb10371029a145a2357573

virtual void* Geo::GeoMemoryDefault::Realloc

...

public: virtual void * Realloc
(
    void * mem,
    size_t size,
    size_t align,
    const char * filename,
    s32 lineNumber,
    const char * message
)

...

Reallocate a block of memory, preserving as much data as will fit in the new block size.

Requires the same alignment as in the original allocation.


Anchor
a80dec670b9cbec0431f0f1400fcdfecd
a80dec670b9cbec0431f0f1400fcdfecd

void Geo::GeoMemoryDefault::SetMaximumHeapSize

...

public: void SetMaximumHeapSize
(
    Geo::u64 size
)

...

Sets the maximum amount of memory that is allowed to be allocated. Allocations after this size has been reached will return NULL.