@adobe/data - v0.10.30
    Preparing search index...

    Interface MemoryAllocator

    interface MemoryAllocator {
        needsRefresh: Observe<void>;
        allocate<T extends TypedArray>(
            typedArray: TypedArrayConstructorOf<T>,
            sizeInElements: number,
        ): T;
        refresh<T extends TypedArray>(typedArray: T): T;
        release(buffer: TypedArray): void;
    }
    Index

    Properties

    needsRefresh: Observe<void>

    An observable event source that notifies when previously handed-out typed arrays may have detached (e.g. after a WebAssembly.Memory.grow) and every live view must be refreshed via MemoryAllocator.refresh.

    Methods

    • Allocate a new typed array of the specified size.

      Type Parameters

      Parameters

      • typedArray: TypedArrayConstructorOf<T>
      • sizeInElements: number

      Returns T

    • Refresh the given typed array to ensure that it is not detached. If it is detached a new typed array is created and returned.

      Type Parameters

      Parameters

      • typedArray: T

      Returns T