Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IMemPoolArray

Hierarchy

Implemented by

Index

Methods

callocAs

  • callocAs<T>(type: T, num: number, fill?: number): undefined | TypedArrayTypeMap[T]
  • Similar to IMemPoolArray.mallocAs, but if allocation was successful also clears the allocated block w/ fill value (default: 0).

    Type parameters

    • T: Type

    Parameters

    • type: T

      -

    • num: number

      -

    • Optional fill: number

      -

    Returns undefined | TypedArrayTypeMap[T]

free

  • free(arr: TypedArray): boolean
  • Frees mem block associated with given typed array

    Parameters

    • arr: TypedArray

      -

    Returns boolean

freeAll

  • freeAll(): void
  • Frees all previously allocated blocks and resests allocator state.

    Returns void

mallocAs

  • mallocAs<T>(type: T, num: number): undefined | TypedArrayTypeMap[T]
  • Takes a Type enum and element count num (in units of given type). Similar to IMemPool.malloc and if successful returns typed array of given type. Returns undefined if allocation failed.

    Type parameters

    • T: Type

    Parameters

    • type: T

      -

    • num: number

      -

    Returns undefined | TypedArrayTypeMap[T]

reallocArray

  • reallocArray<T>(arr: T, num: number): undefined | T

release

  • release(opt?: any): boolean
  • Parameters

    • Optional opt: any

    Returns boolean

Generated using TypeDoc