-
Notifications
You must be signed in to change notification settings - Fork 44
Prevent stale uncounted references #865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| u3z(a), a = t; | ||
| } while ( u3_nul != a ); | ||
|
|
||
| u3z(a); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bonus commit: pretty printer measured the length of the atom multiple times for some reason
pkg/noun/nock.c
Outdated
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NB: I haven't closely reviewed the parser jet changes yet.
joemfb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tyfys
Resolves #861
To check:
parsers.curwasm.c