This is the multi-page printable view of this section. Click here to print...

Return to the regular view of this page

As of 2025-07-24

alloc

Memory Allocation
    Used as a template argument for container classes (smplbuf, smplque) to specify or allocate internal memory regions.
    Class NameDescription
    alloc_attach<T>Attach an existing buffer
    alloc_local<T, int N>Statically allocate a buffer of N bytes internally
    alloc_heap<T>Allocate the specified size on the heap

    For alloc_attach and alloc_heap, you must call the appropriate initialization method (init_???()) depending on the allocator type.

    Initialization

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

    Initializes 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()

    These methods trigger a compile-time error using static_assert if an incompatible allocator method is used.