jlbun
    Preparing search index...

    Class JuliaScope

    Index

    Constructors

    Accessors

    • get isDisposed(): boolean

      Check if the scope has been disposed.

      Returns boolean

    • get isPerfMode(): boolean
      Internal

      Whether this scope uses the lock-free perf root stack.

      Returns boolean

    • get isTrackingEnabled(): boolean
      Internal

      Whether auto-tracking is currently enabled.

      Returns boolean

    • get size(): number

      Get the number of tracked objects in this scope. Note: With scope-based tracking, this returns the number explicitly tracked.

      Returns number

    Methods

    • Dispose the scope and release all tracked Julia objects.

      Returns void

    • Remove a value from tracking (escape from scope). The value will survive scope disposal.

      Implementation: Transfer the value to global scope (id=0) which is never auto-released.

      Note: In perf mode, escape() re-pushes the value to the default GC stack with FinalizationRegistry cleanup. The original perf stack slot is still released.

      Type Parameters

      Parameters

      • value: T

        The Julia value to escape

      Returns T

      The same value

    • Internal

      Root a raw Julia pointer in this scope before wrapping/type inspection.

      Parameters

      • ptr: Pointer

      Returns number

    • Internal

      Release a raw pointer root created by protectPointer().

      Parameters

      • idx: number

      Returns void

    • Internal

      Run a callback with this scope as the active async context.

      Type Parameters

      • T

      Parameters

      • fn: () => T

      Returns T

    • Track a Julia value in this scope. When the scope is disposed, all tracked values will be released.

      Note: Calling track() multiple times on the same value in the same scope is idempotent. Values owned by another active scope are rejected.

      Type Parameters

      Parameters

      • value: T

        The Julia value to track

      Returns T

      The same value (for chaining)

    • Execute a function without auto-tracking returned values.

      Type Parameters

      • T

      Parameters

      • fn: () => T

        The function to execute

      Returns T

      The return value of the function