alloc

Specified as a template argument of a container class (smplbuf, smplque) to allocate or specify an area of memory to be used internally.

This class is not called directly from user code, but is used internally to declare containers.

Class NameContents

alloc_attach<T>

specify an already existing buffer

alloc_local<T, int N>

statically allocate a buffer of N bytes internally

alloc_heap<T>

allocate a buffer of the specified size in the heap

In alloc_attach and alloc_heap, initialization methods (init_???()) must be executed according to the memory allocation class.

initialization

void attach(T* p, int n) // alloc_attach
void init_local()        // alloc_local
void init_heap(int n)    // alloc_heap

Initialize with buffer p and size n.

Methods

alloc_size()

uint16_t alloc_size()

Returns the size of the buffer.

_is_attach(), _is_local(), _is_heap()

This method is used to generate a compile error, like static_assert, for a method call description that is different from the expected alloc class.

最終更新