Skip to content
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

serf: stay in an inner road between events #540

Draft
wants to merge 9 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/noun/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -2088,6 +2088,7 @@ u3m_stop()
{
u3e_stop();
u3je_secp_stop();
c3_free(u3D.ray_u);
}

/* u3m_boot(): start the u3 system. return next event, starting from 1.
Expand Down
4 changes: 2 additions & 2 deletions pkg/noun/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ u3s_cue_xeno_init_with(c3_d pre_d, c3_d siz_d)
{
u3_cue_xeno* sil_u;

u3_assert( &(u3H->rod_u) == u3R );
// u3_assert( &(u3H->rod_u) == u3R );

sil_u = c3_calloc(sizeof(*sil_u));
ur_dict32_grow((ur_root_t*)0, &sil_u->dic_u, pre_d, siz_d);
Expand All @@ -645,7 +645,7 @@ u3s_cue_xeno_with(u3_cue_xeno* sil_u,
{
u3_weak som;

u3_assert( &(u3H->rod_u) == u3R );
// u3_assert( &(u3H->rod_u) == u3R );

som = _cs_cue_xeno(sil_u, len_d, byt_y);
ur_dict32_wipe(&sil_u->dic_u);
Expand Down
34 changes: 34 additions & 0 deletions pkg/noun/vortex.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,16 @@ u3v_lily(u3_noun fot, u3_noun txt, c3_l* tid_l)
}
}

/* u3v_peek_raw2(): raw +peek
*/
u3_noun
u3v_peek_raw2(u3_noun roc, u3_noun sam)
{
u3_noun fol = u3k(u3x_at(_CVX_PEEK, roc));
u3_noun fun = u3n_nock_on(roc, fol);
return u3n_slam_on(fun, sam);
}

/* u3v_peek(): query the reck namespace (protected).
*/
u3_noun
Expand Down Expand Up @@ -321,6 +331,30 @@ u3v_poke_raw(u3_noun sam)
return pro;
}

/* u3v_poke_raw2(): raw +poke
*/
u3_noun
u3v_poke_raw2(u3_noun roc, u3_noun sam)
{
u3_noun fol = u3k(u3x_at(_CVX_POKE, roc));
u3_noun fun = u3n_nock_on(roc, fol);
u3_noun pro;

{
# ifdef U3_MEMORY_DEBUG
c3_w cod_w = u3a_lush(u3h(u3t(u3t(sam))));
# endif

pro = u3n_slam_on(fun, sam);

# ifdef U3_MEMORY_DEBUG
u3a_lop(cod_w);
# endif
}

return pro;
}

/* u3v_poke_sure(): inject an event, saving new state if successful.
*/
c3_o
Expand Down
10 changes: 10 additions & 0 deletions pkg/noun/vortex.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@
c3_o
u3v_lily(u3_noun fot, u3_noun txt, c3_l* tid_l);

/* u3v_peek_raw2(): raw +peek
*/
u3_noun
u3v_peek_raw2(u3_noun roc, u3_noun sam);

/* u3v_peek(): query the reck namespace.
*/
u3_noun
Expand All @@ -96,6 +101,11 @@
u3_noun
u3v_soft_peek(c3_w mil_w, u3_noun sam);

/* u3v_poke_raw2(): raw +poke
*/
u3_noun
u3v_poke_raw2(u3_noun roc, u3_noun sam);

/* u3v_poke(): insert and apply an input ovum (protected).
*/
u3_noun
Expand Down
9 changes: 8 additions & 1 deletion pkg/vere/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,13 @@ _cw_serf_writ(void* vod_p, c3_d len_d, c3_y* byt_y)
u3t_event_trace("serf ipc cue", 'B');
#endif

if ( !(u3V.fag_e & u3_serf_inn_e) ) {
// u3_assert( &(u3H->rod_u) == u3R );
u3m_hate(1 << 18);
u3V.fag_e |= u3_serf_inn_e;
// u3_assert( &(u3H->rod_u) != u3R );
}

jar = u3s_cue_xeno_with(sil_u, len_d, byt_y);

#ifdef SERF_TRACE_CUE
Expand Down Expand Up @@ -1645,7 +1652,7 @@ _cw_grab(c3_i argc, c3_c* argv[])

u3m_boot(u3_Host.dir_c, (size_t)1 << u3_Host.ops_u.lom_y);
u3C.wag_w |= u3o_hashless;
u3_serf_grab();
u3_serf_grab(0);
u3m_stop();
}

Expand Down
Loading