jlbun
    Preparing search index...

    Class JuliaScope

    Index

    Constructors

    Accessors

    • get isDisposed(): boolean

      Check if the scope has been disposed.

      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

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

      Note: This pushes the value to the GC stack. Calling track() multiple times on the same value will push it multiple times. This is intentional for performance - the model doesn't do deduplication.

      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