Prevent stale uncounted references#865
Conversation
| u3z(a), a = t; | ||
| } while ( u3_nul != a ); | ||
|
|
||
| u3z(a); |
There was a problem hiding this comment.
A note for list logic jets: almost all changes include a transfer loop, where at the entry we gain a reference to a and then iterate over the list, gaining its tail and losing the list, then replacing the list with its tail. It means that at the end of the loop we still have a reference to a noun in a. We almost never lose it though, because a is 0, except for +levy/+lien, where we might break from the loop earlier.
There was a problem hiding this comment.
technically the very first gain of the list is not necessary and we could unroll the loop, doing things as usual in the first iteration and starting to count the references after that, but IMO whatever gain we get from that is not worth the bloated code
|
|
||
| if ( _(_cm_is_tas(som, len_w)) ) { | ||
| c3_w len_w = u3r_met(3, som); | ||
|
|
There was a problem hiding this comment.
bonus commit: pretty printer measured the length of the atom multiple times for some reason
| u3_noun gul = u3nt(u3nc(1, 0), u3nc(0, 0), 0); // |~(^ ~) XX 409: just pass ~ | ||
|
|
||
| return u3n_nock_et(gul, bus, fol); | ||
| return u3n_nock_et(u3_nul, bus, fol); |
There was a problem hiding this comment.
u3m_soft_run now can take 0 instead of a scry gate to mean the same thing as _~, right?
There was a problem hiding this comment.
It doesn't mean exactly the same thing: this will bail exit, while the prior behavior would block. But this function appears to be unused, so it's not clear that it matters.
There was a problem hiding this comment.
the function is used in urwasm where the behavior is imporant.
in ++mink definition in hoon.hoon scry gate ~ always blocks. In u3m_soft_esc there is no check, so that would indeed be bail exit. That's a bug, right?
There was a problem hiding this comment.
yep, this is a jet mismatch:
> .*([-:mink [[0 [%12 1+0 1+0]] ~] +>:mink] -:mink)
[1 0]
> (mink [[0 [%12 1+0 1+0]] ~])
[%2 trace=~]
There was a problem hiding this comment.
Good catch. The mismatch comes from urbit/urbit#7124 and the hoon is wrong -- +mink should crash if there is no scry handler.
joemfb
left a comment
There was a problem hiding this comment.
NB: I haven't closely reviewed the parser jet changes yet.
Resolves #861
To check:
parsers.curwasm.c