Skip to main content

Module winref

Module winref 

Source
Expand description

ref arguments bound to a window of a variable or class property (LRM 1800-2023 13.5.2): f(s.n), f(v[3:0]), f(obj.x), f(g).

The callee accesses the actual directly, so a body that writes the same storage through another path while it holds the ref (the module variable, the class handle, a nested call) must see one location. A compiled function holds such a ref as a reference id like an element reference of a queue (collections::ref_open), but the id names a window of a root image instead: the root’s bytes in the caller’s frame, or a class property’s words in the object heap. The image is the packed value (unk << W) | val of codegen (a 2-state build: val alone).

Ids carry WIN_BIT so they never collide with an element reference’s.

Constants§

WIN_BIT
Set in the id of every window reference.

Functions§

close
Closes window reference id.
get_part
Part [lo, lo + w) of the big_w-bit root that window id names, into out as a w-bit packed (unk << w) | val. A bit past the root reads as 0. false when id is no open window or its object is dead (out is then left alone).
is_window
Whether id names a window reference.
open_field
Opens a window reference on the class property slot of object h.
open_mem⚠
Opens a window reference on the root image at addr.
put_part
Writes the w-bit packed val into part [lo, lo + w) of the root that window id names, keeping the root’s other bits as they are now.