Skip to content

Allocation

struct Allocation

A single memory allocation.

This struct describes a single memory allocation. It is used to track memory allocations made by the engine for each pool, and inspect memory leaks.

Variables

Name Description
pool The memory pool.
address The address of the allocation.
size The size of the allocation.
file The file in which the allocation was made.
line The line in which the allocation was made.

Operators

Name Description
AmVoidPtr Explicit conversion to the address of the allocation.
operator== Checks if the address matches the provided pointer.
operator== Checks if the address matches the provided pointer.
operator< Checks if the address is less than the provided address.

Variable Details

address

AmVoidPtr address

The address of the allocation.

file

const char* file

The file in which the allocation was made.

line

AmUInt32 line

The line in which the allocation was made.

pool

MemoryPoolKind pool

The memory pool.

size

AmSize size

The size of the allocation.

Operator Details

AmVoidPtr

[[nodiscard]] inline explicit operator AmVoidPtr() const

Explicit conversion to the address of the allocation.

Return
The address of the allocation.

operator<

[[nodiscard]] inline bool operator<(const Allocation& other) const

Checks if the address is less than the provided address.

Parameter other
The other allocation to compare with.
Return
true if the addresses are less than, false otherwise.

operator==

[[nodiscard]] inline bool operator==(const AmVoidPtr& ptr) const

Checks if the address matches the provided pointer.

Parameter ptr
The pointer to compare with.
Return
true if the addresses match, false otherwise.

[[nodiscard]] inline bool operator==(const Allocation& other) const

Checks if the address matches the provided pointer.

Parameter ptr
The pointer to compare with.
Return
true if the addresses match, false otherwise.