pub struct ProcStack { /* private fields */ }Expand description
The records whose dbProcess frame is live on the current chain.
C keeps this marker on the record — processTarget claims
dbRec2Pvt(pdst)->procThread before dbProcess(pdst)
(dbDbLink.c:500-503) and the frame that claimed it clears it on unwind
(:523-526). The port cannot put it there: its frame has released the
record lock by the time it unwinds, and re-taking it to clear a flag would
cost more than the marker saves. So the marker travels with the chain.
What it travelled in was a HashSet<Arc<str>>, which hashed the record
name on the way in and again on the way out and allocated a table to hold,
at the depth a scan cycle actually reaches, one entry. The depth is the
point: a scan of a record whose links are unwired is depth one, so the
first claim lives in a field and only a real cascade allocates.
The entry is the record cell’s identity, as C’s marker is on the record itself: an alias claims the same entry as its target, and a claim costs no name clone or compare.
Implementations§
Source§impl ProcStack
impl ProcStack
pub fn new() -> Self
Sourcepub fn claim(&mut self, rec: &Arc<RecordCell>) -> bool
pub fn claim(&mut self, rec: &Arc<RecordCell>) -> bool
Claim name for the calling frame. false when it is already on the
chain — C’s cycle — and then the caller has claimed nothing and must
not release anything.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether no frame is live on this chain — the entry is the outermost.
Sourcepub fn holds(&self, rec: &Arc<RecordCell>) -> bool
pub fn holds(&self, rec: &Arc<RecordCell>) -> bool
Whether a frame for rec is live on this chain.