Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Allocators

AZStd uses simple and fast allocator model, it does not follow the CStd. It is not templated on any type, thus is doesn't care about construction or destruction. We do require name support, in most cases should be just a pointer to a literal.

This is the specification for an AZSTD allocator:

class allocator
{
public:
// Type of the returned pointer. Usually void*
typedef <impl defined> pointer;
// Size type, any container using this allocator will use this size_type. Usually AZStd::size_t
typedef <impl defined> size_type;
// Pointer difference type, usually AZStd::ptrdiff_t.
typedef <impl defined> difference_type;
allocator(const char* name = "AZSTD Allocator");
allocator(const allocator& rhs);
allocator(const allocator& rhs, const char* name);
allocator& operator=(const allocator& rhs;
pointer allocate(size_type byteSize, size_type alignment);
void deallocate(pointer ptr, size_type byteSize, size_type alignment);
size_type resize(pointer ptr, size_type newSize);
const char* get_name() const;
void set_name(const char* name);
// Returns theoretical maximum size of a single contiguous allocation from this allocator.
size_type max_size() const;
<optional> size_type get_allocated_size() const;
};
bool operator==(const allocator& a, const allocator& b);
bool operator!=(const allocator& a, const allocator& b);