Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace memory

A namespace that represents the exports from the memory sub-package.

remarks

You can import this namespace via import {memory} from "@convergejs/converge", or import its exports directly via import {...} from "@convergejs/converge/memory".

Index

Type Aliases

GlobalBuffer: readonly [globalPtr: GlobalPtr, sab: SharedArrayBuffer]

A type that represents a tuple containing a global pointer and a shared buffer to which the global pointer relates.

GlobalPtr: number

A pseudo pointer to global memory.

MarshalTargetConstructor: Constructor<typeof Memory | typeof SharedArrayBuffer | Implementing<SharedObject>>
SharedObjectOptions: { memory: MemoryType }

Options for use with the @shared(...) class decorator.

Type declaration

  • memory: MemoryType

    The memory type that instances of the shared object are expected to use.

    remarks

    Defaults to managed.

Variables

MemorySymbol: { byteLength: string; byteOffset: string; obj: string }
internal

Type declaration

  • byteLength: string
  • byteOffset: string
  • obj: string
SharedObjectSymbol: { flags: typeof FlagsSymbol; initializeFromMemory: typeof InitializeFromMemorySymbol; memory: typeof MemorySymbol }

Provides symbols for properties and methods related to shared objects.

Type declaration

  • flags: typeof FlagsSymbol

    A property that gets or sets the flags declared for the shared object type.

  • initializeFromMemory: typeof InitializeFromMemorySymbol

    A method that is invoked on a shared object when it is to be marshalled from memory.

  • memory: typeof MemorySymbol

    A property that gets or sets the memory that is associated with the shared object.

Functions

  • doSomething(): number
  • Returns number

  • isGlobalPtr(obj: unknown): obj is number
  • A type guard for GlobalPtr.

    Parameters

    • obj: unknown

      The object to test.

    Returns obj is number

    true if obj is a global pointer; otherwise false.

  • isLocalMemory(obj: unknown): obj is Memory
  • A type guard for Memory objects.

    Parameters

    • obj: unknown

      The object to test.

    Returns obj is Memory

    true if obj is a Memory instance, and the memory is associated with a local buffer; otherwise false.

  • isMemory(obj: unknown): obj is Memory
  • A type guard for Memory objects.

    Parameters

    • obj: unknown

      The object to test.

    Returns obj is Memory

    true if obj is a Memory instance; otherwise false.

  • A type guard for shared objects.

    Parameters

    • obj: unknown

      The object to test.

    Returns obj is SharedObjectLike

    true if obj is a shared object; otherwise false.

  • A type guard for Constructor where the returned instance of the constructor is a shared object.

    Parameters

    • target: Constructor<any, unknown[]>

      The constructor type to test.

    Returns target is Constructor<Implementing<SharedObjectLike>, unknown[]>

    true if target is a constructor for a shared object; otherwise false.

  • Returns a class decorator that provides the implementation of a shared object.

    see

    SharedObjectOptions

    Parameters

    • Optional options: Partial<SharedObjectOptions>

      Options that will be used in configuring the shared object implementation.

    Returns (<T>(target: T) => T)

    A class decorator that mixes in an implementation of SharedObject for a given target at runtime.

      • <T>(target: T): T
      • Returns a class decorator that provides the implementation of a shared object.

        see

        SharedObjectOptions

        Type Parameters

        Parameters

        • target: T

        Returns T

        A class decorator that mixes in an implementation of SharedObject for a given target at runtime.

Generated using TypeDoc