litert::Mallocator

#include <litert_buffer_ref.h>

Defines allocation and deallocation behavior for owning buffer refs.

Summary

An allocator is a trivially constructible/destructible object that overrides operator() for allocating and freeing memory. A memory allocator based on malloc and free.

Details
Template Parameters
ByteT
The byte type of the buffer.

Public functions

operator()(ByteT *d)
void
Frees the given memory block.
operator()(size_t bytes)
ByteT *
Allocates a memory block of the specified size.

Public functions

operator()

void litert::Mallocator::operator()(
  ByteT *d
)

Frees the given memory block.

operator()

ByteT * litert::Mallocator::operator()(
  size_t bytes
)

Allocates a memory block of the specified size.

Details
Parameters
bytes
The size of the memory block in bytes.
Returns
A pointer to the allocated memory.