@thi.ng/malloc
    Preparing search index...

    Interface MemPoolOpts

    interface MemPoolOpts {
        align: Pow2;
        buf: ArrayBufferLike;
        compact: boolean;
        end: number;
        minSplit: number;
        size: number;
        skipInitialization: boolean;
        split: boolean;
        start: number;
    }
    Index

    Properties

    align: Pow2

    Number of bytes to align memory blocks to. MUST be a power of 2 and >= 8. Use 16 if the pool is being used for allocating memory used in SIMD operations.

    8
    
    buf: ArrayBufferLike

    Backing ArrayBuffer (or SharedArrayBuffer). If not given, a new one will be created with given size.

    compact: boolean

    Flag to configure memory block compaction. If true, adjoining free blocks (in terms of address space) will be merged to minimize fragementation.

    true
    
    end: number

    Byte address (+1) of the end of the memory region managed by the MemPool.

    end of the backing ArrayBuffer
    
    minSplit: number

    Only used if split behavior is enabled. Defines min number of excess bytes available in a block for memory block splitting to occur.

    16, MUST be > 8
    
    size: number

    Byte size for newly created ArrayBuffers (if buf is not given).

    0x1000 (4KB)
    
    skipInitialization: boolean

    Only needed when sharing the underlying ArrayBuffer. If true, the MemPool constructor will NOT initialize its internal state and assume the underlying ArrayBuffer has already been initialized by another MemPool instance. If this option is used, buf MUST be given.

    false
    
    split: boolean

    Flag to configure memory block splitting. If true, and when the allocator is re-using a previously freed block larger than the requested size, the block will be split to minimize wasted/unused memory. The splitting behavior can further customized via the minSplit option.

    true
    
    start: number

    Anchor index (byte address) inside the array buffer. The MemPool stores its internal state from the given address and heap space starts at least 32 bytes later (depending on chosen align value). Unlike allocator state variables, `start`` cannot be saved inside the array buffer itself. If the ArrayBuffer is passed to other consumers they must use the same start value. MUST be multiple of 4.

    0