mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 18:12:47 +03:00
Merge pull request #2922 from urbit/rock-load-tweaks
vere: improves jammed state reloading in |pack
This commit is contained in:
commit
32f7bfca90
@ -1742,7 +1742,7 @@ u3m_rock_load(c3_c* dir_c, c3_d evt_d)
|
|||||||
// XX u3m_file bails, but we'd prefer to return errors
|
// XX u3m_file bails, but we'd prefer to return errors
|
||||||
//
|
//
|
||||||
u3_noun fil = u3m_file(nam_c);
|
u3_noun fil = u3m_file(nam_c);
|
||||||
u3a_print_memory(stderr, "rock: load", u3r_met(3, fil));
|
u3a_print_memory(stderr, "rock: load", u3r_met(5, fil));
|
||||||
|
|
||||||
u3_noun pro = u3m_soft(0, u3ke_cue, fil);
|
u3_noun pro = u3m_soft(0, u3ke_cue, fil);
|
||||||
|
|
||||||
|
@ -1092,10 +1092,14 @@ u3r_mp(mpz_t a_mp,
|
|||||||
u3a_atom* b_u = u3a_to_ptr(b);
|
u3a_atom* b_u = u3a_to_ptr(b);
|
||||||
c3_w len_w = b_u->len_w;
|
c3_w len_w = b_u->len_w;
|
||||||
|
|
||||||
// slight deficiency in the GMP API.
|
// avoid reallocation on import, if possible
|
||||||
//
|
//
|
||||||
c3_assert(!(len_w >> 27));
|
if ( (len_w >> 27) ) {
|
||||||
mpz_init2(a_mp, len_w << 5);
|
mpz_init(a_mp);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mpz_init2(a_mp, len_w << 5);
|
||||||
|
}
|
||||||
|
|
||||||
mpz_import(a_mp, len_w, -1, sizeof(c3_w), 0, 0, b_u->buf_w);
|
mpz_import(a_mp, len_w, -1, sizeof(c3_w), 0, 0, b_u->buf_w);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user