jets: Rebuild pills, the enabled jets here now don't leak memory.

This commit is contained in:
Elliot Glaysher 2020-05-04 10:34:46 -07:00
parent 1eb2e58bb7
commit bf1f08e698
9 changed files with 54 additions and 38 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:418f7512f9ff24de9c222cb4f666ef892c35376c7ee50f9f9e389c7ffa4711fc
size 10010102
oid sha256:b1b680d53c24ddda774d51baa96d1d7c15d1f71ecbe17aaf82422fc878dd05d3
size 10013370

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9d131da321b891c126f62cc587c5e27c257695ff9ae15e502356159fba7f9bf3
size 1234415
oid sha256:29473ada25ac5ce2dbd5c14ede755c375d29f2c6da13c03b727a55220627c756
size 1234682

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:816bb2cb6b59153c611ef8bc5342c2e02eb5ef3514f8f510c5aa2387df92e9a9
size 12470565
oid sha256:a46c3a2f749bca8d5e9d447060c8cb0ab5251522276bc8f8e956b06a64d83e17
size 12473821

View File

@ -2136,6 +2136,7 @@
~% %tri +
==
%year year
%yore yore
==
|%
::

View File

@ -91,7 +91,7 @@ u3qc_ob_fen(u3_atom r,
while (1) {
if (c3y == u3qa_lth(j, 1)) {
return u3qa_add(u3qa_mul(arr, a), ell);
return u3ka_add(u3qa_mul(arr, a), ell);
}
u3_atom f = (*prf_fun)(u3qa_sub(j, 1), ell, datum_u);
@ -148,21 +148,20 @@ u3qc_ob_fe(u3_atom r,
u3_atom m)
{
u3_atom j = 1;
u3_atom ell = u3qa_mod(u3k(m), u3k(a));
u3_atom arr = u3qa_div(u3k(m), u3k(a));
u3z(a);
u3_atom ell = u3qa_mod(m, a);
u3_atom arr = u3qa_div(m, a);
while (1) {
if (c3y == u3qa_gth(j, r)) {
if (c3n == u3r_sing(u3qa_mod(r, 2), 0)) {
return u3qa_add(u3qa_mul(arr, a), ell);
return u3ka_add(u3ka_mul(arr, u3k(a)), ell);
}
if (c3y == u3r_sing(arr, a)) {
return u3qa_add(u3qa_mul(arr, a), ell);
return u3ka_add(u3ka_mul(arr, u3k(a)), ell);
}
return u3qa_add(u3qa_mul(ell, a), arr);
return u3ka_add(u3ka_mul(ell, u3k(a)), arr);
}
// u3_atom f = u3j_gate_slam(prf_u, u3nc(u3qa_sub(j, 1), arr));
@ -170,12 +169,13 @@ u3qc_ob_fe(u3_atom r,
u3_atom tmp;
if (c3n == u3r_sing(u3qa_mod(j, 2), 0)) {
tmp = u3qa_mod(u3qa_add(f, ell), a);
tmp = u3ka_mod(u3qa_add(f, ell), u3k(a));
} else {
tmp = u3qa_mod(u3qa_add(f, ell), b);
tmp = u3ka_mod(u3qa_add(f, ell), u3k(b));
}
j = u3qa_add(j, 1);
u3z(ell);
ell = arr;
arr = tmp;
}
@ -397,23 +397,32 @@ u3qc_ob_fein(u3_atom pyn)
c3_d BIGGEST_PLANET = 0xffffffffULL;
c3_d SMALLEST_MOON = 0x100000000ULL;
c3_d BIGGEST_MOON = 0xffffffffffffffffULL;
c3_d MOON_MASK = 0xffffffff00000000ULL;
if (c3y == u3qa_gte(u3k(pyn), 0x10000) &&
c3y == u3qa_lte(u3k(pyn), u3i_chubs(1, &BIGGEST_PLANET))) {
return u3qa_add(0x10000, u3qc_ob_feis(u3qa_sub(pyn, 0x10000)));
u3_atom biggest_plannet = u3i_chubs(1, &BIGGEST_PLANET);
if (c3y == u3qa_gte(pyn, 0x10000) &&
c3y == u3qa_lte(pyn, biggest_plannet)) {
u3_atom s = u3qa_sub(pyn, 0x10000);
u3_atom f = u3qc_ob_feis(s);
u3z(s);
u3z(biggest_plannet);
return u3ka_add(0x10000, f);
}
if (c3y == u3qa_gte(u3k(pyn), u3i_chubs(1, &SMALLEST_MOON)) &&
c3y == u3qa_lte(u3k(pyn), u3i_chubs(1, &BIGGEST_MOON))) {
u3_atom lo = u3qc_dis(u3k(pyn), u3i_chubs(1, &BIGGEST_PLANET));
u3_atom hi = u3qc_dis(u3k(pyn), u3i_chubs(1, &MOON_MASK));
u3z(pyn);
return u3qc_con(hi, u3qc_ob_fein(lo));
if (c3y == u3qa_gte(pyn, u3i_chubs(1, &SMALLEST_MOON)) &&
c3y == u3qa_lte(pyn, u3i_chubs(1, &BIGGEST_MOON))) {
u3_atom lo = u3qc_dis(pyn, biggest_plannet);
u3_atom hi = u3qc_dis(pyn, u3i_chubs(1, &MOON_MASK));
u3_atom fein_lo = u3qc_ob_fein(lo);
u3z(lo);
u3z(biggest_plannet);
return u3kc_con(hi, fein_lo);
}
return pyn;
u3z(biggest_plannet);
return u3k(pyn);
}
u3_noun

View File

@ -55,13 +55,11 @@ static
u3_noun
_print_da(u3_atom cor, u3_atom raw_da)
{
u3l_log("about to cook");
u3_noun hok = u3j_cook("u3we_scow_print_da", u3k(cor), "yore");
u3l_log("cooked");
u3_noun yod = u3n_slam_on(hok, u3k(raw_da));
u3_noun out = 0;
u3m_p("yod", yod);
// u3m_p("yod", yod);
u3_atom age, year, month, day, hour, min, sec, f;
if (c3n == u3r_mean(yod, 4, &age,
@ -288,15 +286,15 @@ u3we_scot(u3_noun cor)
}
switch (mod) {
// TODO: This causes a bail fail. why?
/* case c3__da: { */
/* u3_noun x = _print_da(cor, atom); */
/* if (x == u3_none) { */
/* return x; */
/* } */
/* return u3qc_rap(3, x); */
/* } */
case c3__da: {
u3_noun x = _print_da(cor, atom);
if (x == u3_none) {
return x;
}
u3_noun ret = u3qc_rap(3, x);
u3z(x);
return ret;
}
/* case 'p': */
/* return u3qc_rap(3, _print_p(atom)); */

View File

@ -1002,6 +1002,7 @@ _me_gain_use(u3_noun dog)
u3a_box* box_u = u3a_botox(dog_w);
if ( 0x7fffffff == box_u->use_w ) {
u3l_log("fail in _me_gain_use");
u3m_bail(c3__fail);
}
else {

View File

@ -950,11 +950,13 @@ _cj_hook_in(u3_noun cor,
u3_noun roc, tem, got, pat, nam, huc;
if ( c3n == u3du(cor) ) {
u3l_log("_cj_hook_in failure: c3n == u3du(cor)\r\n");
return u3m_bail(c3__fail);
}
loc = _cj_spot(cor, NULL);
if ( u3_none == loc ) {
u3l_log("_cj_hook_in failure: u3_none == loc\r\n");
return u3m_bail(c3__fail);
}
@ -1019,6 +1021,7 @@ _cj_hook_in(u3_noun cor,
else {
u3_noun sat = u3t(pat);
if ( c3y == u3h(sat) ) {
u3l_log("_cj_hook_in failure: c3y == u3h(sat)\r\n");
return u3m_bail(c3__fail);
}
else {
@ -1158,11 +1161,13 @@ _cj_hank_fill(_cj_hank* han_u, u3_noun tam, u3_noun cor)
u3j_site* sit_u = &(han_u->sit_u);
if ( c3n == u3du(cor) ) {
u3l_log("fail in _cj_hank_fill (c3n == u3du(cor))");
return u3m_bail(c3__fail);
}
sit_u->bas = u3_none;
if ( u3_none == (col = loc = _cj_spot(cor, NULL)) ) {
u3l_log("fail in _cj_hank_fill (_cj_spot(cor, NULL))");
return u3m_bail(c3__fail);
}
@ -1205,6 +1210,7 @@ _cj_hank_fill(_cj_hank* han_u, u3_noun tam, u3_noun cor)
else {
u3_noun sat = u3t(pat);
if ( c3y == u3h(sat) ) {
u3l_log("fail in _cj_hank_fill (c3y == u3h(sat))");
return u3m_bail(c3__fail);
}
else {

View File

@ -90,6 +90,7 @@ u3_walk_load(c3_c* pas_c)
if ( fln_w != red_w ) {
c3_free(pad_y);
u3l_log("u3_walk_load failed");
return u3m_bail(c3__fail);
}
else {