move m_unit out of header file

This commit is contained in:
dzaima 2022-08-21 15:46:25 +03:00
parent c69a3373b9
commit 5112796cfd
4 changed files with 13 additions and 20 deletions

View File

@ -161,7 +161,17 @@ B withFill(B x, B fill) { // consumes both
return taga(r);
}
B m_atomUnit(B x) {
NOINLINE B m_unit(B x) {
B xf = asFill(inc(x));
if (noFill(xf)) return m_hunit(x);
FillArr* r = m_arr(fsizeof(FillArr,a,B,1), t_fillarr, 1);
arr_shAlloc((Arr*)r, 0);
r->fill = xf;
r->a[0] = x;
return taga(r);
}
NOINLINE B m_atomUnit(B x) {
u64 data; assert(sizeof(f64)<=8);
u8 t;
if (isNum(x)) {

View File

@ -73,21 +73,7 @@ static B m_emptyFVec(B f) { // consumes f
return taga(r);
}
static B m_unit(B x) { // consumes
B xf = asFill(inc(x));
if (noFill(xf)) {
HArr_p r = m_harrUp(1);
arr_shAlloc((Arr*)r.c, 0);
r.a[0] = x;
return r.b;
}
FillArr* r = m_arr(fsizeof(FillArr,a,B,1), t_fillarr, 1);
arr_shAlloc((Arr*)r, 0);
r->fill = xf;
r->a[0] = x;
return taga(r);
}
B m_unit(B x); // consumes
B m_atomUnit(B x); // consumes
static B fill_or(B wf, B xf) { // consumes

View File

@ -94,7 +94,7 @@ static HArr_p m_harrUp(usz ia) {
return harrP_parts(r);
}
static B m_hunit(B x) {
static B m_hunit(B x) { // consumes
HArr_p r = m_harrUp(1);
arr_shAlloc((Arr*)r.c, 0);
r.a[0] = x;

View File

@ -342,9 +342,6 @@ B toCells(B x); // consumes
B toKCells(B x, ur k); // consumes
B withFill(B x, B f); // consumes both
static B m_unit (B x); // consumes
static B m_hunit(B x); // consumes
B bqn_exec(B str, B path, B args); // consumes all
B bqn_execFile(B path, B args); // consumes
B bqn_explain(B str, B path); // consumes str