ScratchHandle<Y extends RType> class final

A live claim on one MemoryScratch slot, returned by MemoryScratch.acquire.

pointer is valid only until release is called, and only as long as no handle acquired after this one is still outstanding. Never retain pointer beyond that window, and never call release more than once per handle (subsequent calls are a no-op).

Properties

hashCode → int
The hash code for this object.
no setterinherited
pointer → MemoryPointer<Y>
Scratch memory for this claim, cast to Y. Contents are short-lived and undefined once release is called or a nested MemoryScratch.acquire invalidates the stack ordering guarantee.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
release() → void
Releases this slot back to MemoryScratch. Must be called exactly once, before releasing any handle acquired before this one. Safe to call from a finally block; idempotent on repeat calls.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited