skia
    Preparing search index...

    Interface MallocObj

    This object is a wrapper around a pointer to some memory on the WASM heap. The type of the pointer was determined at creation time.

    interface MallocObj {
        byteOffset: number;
        length: number;
        subarray(start: number, end: number): TypedArray;
        toTypedArray(): TypedArray;
    }
    Index

    Properties

    byteOffset: number

    The "pointer" into the WASM memory. Should be fixed over the lifetime of the object.

    length: number

    The number of objects this pointer refers to.

    Methods

    • Return a read/write view into a subset of the memory. Do not cache the TypedArray this returns, it may be invalidated if the WASM heap is resized. This is the same as calling .toTypedArray().subarray() except the returned TypedArray can also be passed into an API and not cause an additional copy.

      Parameters

      • start: number
      • end: number

      Returns TypedArray

    • Return a read/write view of the memory. Do not cache the TypedArray this returns, it may be invalidated if the WASM heap is resized. If this TypedArray is passed into a CanvasKit API, it will not be copied again, only the pointer will be re-used.

      Returns TypedArray