From 5112796cfd757500d68bd177441173965171fed5 Mon Sep 17 00:00:00 2001 From: dzaima Date: Sun, 21 Aug 2022 15:46:25 +0300 Subject: [PATCH] move m_unit out of header file --- src/core/fillarr.c | 12 +++++++++++- src/core/fillarr.h | 16 +--------------- src/core/harr.h | 2 +- src/h.h | 3 --- 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/core/fillarr.c b/src/core/fillarr.c index 47d2d0e2..c3811071 100644 --- a/src/core/fillarr.c +++ b/src/core/fillarr.c @@ -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)) { diff --git a/src/core/fillarr.h b/src/core/fillarr.h index f4f86ccc..b0eee213 100644 --- a/src/core/fillarr.h +++ b/src/core/fillarr.h @@ -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 diff --git a/src/core/harr.h b/src/core/harr.h index c601485c..e6b948b9 100644 --- a/src/core/harr.h +++ b/src/core/harr.h @@ -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; diff --git a/src/h.h b/src/h.h index 7499761a..d4dedd49 100644 --- a/src/h.h +++ b/src/h.h @@ -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