diff --git a/src/builtins/md2.c b/src/builtins/md2.c index 0333ab67..00555f3c 100644 --- a/src/builtins/md2.c +++ b/src/builtins/md2.c @@ -217,13 +217,13 @@ B while_c2(Md2D* d, B w, B x) { B f=d->f; B g=d->g; static B m2c1(B t, B f, B g, B x) { // consumes x B fn = m2_d(inc(t), inc(f), inc(g)); B r = c1(fn, x); - dec(fn); + decG(fn); return r; } static B m2c2(B t, B f, B g, B w, B x) { // consumes w,x B fn = m2_d(inc(t), inc(f), inc(g)); B r = c2(fn, w, x); - dec(fn); + decG(fn); return r; } @@ -281,7 +281,7 @@ B rank_c1(Md2D* d, B x) { B f = d->f; B g = d->g; usz* rsh = HARR_FA(r, k); if (k>1) memcpy(rsh, xsh, k*sizeof(usz)); - dec(x); + decG(x); return bqn_merge(HARR_O(r).b); } extern B rt_rank; diff --git a/src/builtins/sort.c b/src/builtins/sort.c index 0926f9f0..7373cb70 100644 --- a/src/builtins/sort.c +++ b/src/builtins/sort.c @@ -36,7 +36,7 @@ B and_c1(B t, B x) { i32* rp; B r = m_i32arrv(&rp, xia); memcpy(rp, xp, xia*4); iA_tim_sort(rp, xia); - dec(x); + decG(x); return FL_SET(r, fl_asc); } B xf = getFillQ(x); @@ -44,7 +44,7 @@ B and_c1(B t, B x) { SGet(x) for (usz i = 0; i < xia; i++) r.a[i] = Get(x,i); bA_tim_sort(r.a, xia); - dec(x); + decG(x); return FL_SET(withFill(r.b,xf), fl_asc); } @@ -68,7 +68,7 @@ B or_c1(B t, B x) { i32* rp; B r = m_i32arrv(&rp, xia); memcpy(rp, xp, xia*4); iD_tim_sort(rp, xia); - dec(x); + decG(x); return FL_SET(r, fl_dsc); } B xf = getFillQ(x); @@ -76,6 +76,6 @@ B or_c1(B t, B x) { SGet(x) for (usz i = 0; i < xia; i++) r.a[i] = Get(x,i); bD_tim_sort(r.a, xia); - dec(x); + decG(x); return FL_SET(withFill(r.b,xf), fl_dsc); } diff --git a/src/builtins/sysfn.c b/src/builtins/sysfn.c index 67caeb1b..0d2076c5 100644 --- a/src/builtins/sysfn.c +++ b/src/builtins/sysfn.c @@ -68,17 +68,17 @@ B glyph_c1(B t, B x) { #endif if (isPrim(x)) { B r = m_c32(U"+-×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍⋈↑↓↕«»⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!˙˜˘¨⌜⁼´˝`∘○⊸⟜⌾⊘◶⎉⚇⍟⎊"[v(x)->flags-1]); - dec(x); + decG(x); return r; } u8 ty = v(x)->type; - if (ty==t_funBI) { B r = fromUTF8l(pfn_repr(c(Fun,x)->extra)); dec(x); return r; } - if (ty==t_md1BI) { B r = fromUTF8l(pm1_repr(c(Md1,x)->extra)); dec(x); return r; } - if (ty==t_md2BI) { B r = fromUTF8l(pm2_repr(c(Md2,x)->extra)); dec(x); return r; } - if (ty==t_nfn) { B r = nfn_name(x); dec(x); return r; } - if (ty==t_funBl) { dec(x); return m_str8l("(function block)"); } - if (ty==t_md1Bl) { dec(x); return m_str8l("(1-modifier block)"); } - if (ty==t_md2Bl) { dec(x); return m_str8l("(2-modifier block)"); } + if (ty==t_funBI) { B r = fromUTF8l(pfn_repr(c(Fun,x)->extra)); decG(x); return r; } + if (ty==t_md1BI) { B r = fromUTF8l(pm1_repr(c(Md1,x)->extra)); decG(x); return r; } + if (ty==t_md2BI) { B r = fromUTF8l(pm2_repr(c(Md2,x)->extra)); decG(x); return r; } + if (ty==t_nfn) { B r = nfn_name(x); decG(x); return r; } + if (ty==t_funBl) { decG(x); return m_str8l("(function block)"); } + if (ty==t_md1Bl) { decG(x); return m_str8l("(1-modifier block)"); } + if (ty==t_md2Bl) { decG(x); return m_str8l("(2-modifier block)"); } if (ty==t_ns) return nsFmt(x); return m_str32(U"(•Glyph: given object with unexpected type)"); } @@ -135,7 +135,7 @@ B grLen_both(i64 ria, B x) { for (usz i = 0; i < ia; i++) { i64 n = o2i64u(GetU(x, i)); assert(n>=-1); if (n>=0) { - if (bitp_get(rp,n)) { dec(r); goto r_i32; } + if (bitp_get(rp,n)) { decG(r); goto r_i32; } bitp_set(rp,n,1); } } @@ -148,7 +148,7 @@ B grLen_both(i64 ria, B x) { i64 n = o2i64u(GetU(x, i)); assert(n>=-1); if (n>=0) rp[n]++; } - r_r: dec(x); return r; + r_r: decG(x); return r; } B grLen_c1(B t, B x) { return grLen_both( -1, x); } // assumes valid arguments B grLen_c2(B t, B w, B x) { return grLen_both(o2i64u(w)-1, x); } // assumes valid arguments @@ -156,8 +156,8 @@ B grLen_c2(B t, B w, B x) { return grLen_both(o2i64u(w)-1, x); } // assumes vali B grOrd_c2(B t, B w, B x) { // assumes valid arguments usz wia = a(w)->ia; usz xia = a(x)->ia; - if (wia==0) { dec(w); dec(x); return emptyIVec(); } - if (xia==0) { dec(w); return x; } + if (wia==0) { decG(w); decG(x); return emptyIVec(); } + if (xia==0) { decG(w); return x; } SGetU(w) SGetU(x) TALLOC(usz, tmp, wia); @@ -170,7 +170,7 @@ B grOrd_c2(B t, B w, B x) { // assumes valid arguments i64 c = o2i64(GetU(x,i)); if (c>=0) rp[tmp[c]++] = i; } - dec(w); dec(x); TFREE(tmp); + decG(w); decG(x); TFREE(tmp); return r; } @@ -256,7 +256,7 @@ static B args_path(B* fullpath, B w, char* name) { // consumes w, returns args, B file = ia>1? vfyStr(Get(w,1),name,"filename") : emptyCVec(); B args = ia>2? Get(w,2) : emptySVec(); *fullpath = vec_join(vec_add(path, m_c32('/')), file); - dec(w); + decG(w); return args; } @@ -539,7 +539,7 @@ B reBQN_c1(B t, B x) { HArr_p d = m_harrUv(5); d.a[0] = m_f64(replVal); d.a[1] = scVal; d.a[2]=d.a[3]=d.a[4]=bi_N; init_comp(d.a+2, prim); - dec(x); + decG(x); return m_nfn(reBQNDesc, d.b); } B repl_c2(B t, B w, B x) { @@ -619,7 +619,7 @@ B flines_c2(B d, B w, B x) { dec(x); B p = path_rel(nfn_objU(d), w); path_wChars(inc(p), s); - dec(s); + decG(s); return p; } static NFnDesc* importDesc; @@ -751,7 +751,7 @@ B fromUtf8_c1(B t, B x) { } } B r = fromUTF8(chrs, ia); - dec(x); + decG(x); TFREE(chrs); return r; } diff --git a/src/core/derv.c b/src/core/derv.c index 28d2a20c..f7613dae 100644 --- a/src/core/derv.c +++ b/src/core/derv.c @@ -82,7 +82,7 @@ static B fork_uc1(B t, B o, B x) { B tmp = m_nfn(ucwWrapDesc, tag(args, RAW_TAG)); B r = TI(h,fn_uc1)(h,tmp,x); // f is consumed by the eventual ucwWrap call. this hopes that everything is nice and calls o only once, and within the under call, so any under interface must make sure they can't - dec(tmp); + decG(tmp); return r; } diff --git a/src/core/fillarr.c b/src/core/fillarr.c index a69157b6..5753d96b 100644 --- a/src/core/fillarr.c +++ b/src/core/fillarr.c @@ -7,19 +7,19 @@ B asFill(B x) { // consumes if (elNum(xe)) { Arr* r = allZeroes(ia); arr_shCopy(r, x); - dec(x); + decG(x); return taga(r); } if (elChr(xe)) { u8* rp; B r = m_c8arrc(&rp, x); for (usz i = 0; i < ia; i++) rp[i] = ' '; - dec(x); + decG(x); return r; } M_HARR(r, a(x)->ia) SGet(x) for (usz i = 0; i < ia; i++) { - if (noFill(HARR_ADD(r, i, asFill(Get(x,i))))) { HARR_ABANDON(r); dec(x); return bi_noFill; } + if (noFill(HARR_ADD(r, i, asFill(Get(x,i))))) { HARR_ABANDON(r); decG(x); return bi_noFill; } } B xf = getFillQ(x); return withFill(HARR_FCD(r, x), xf); @@ -37,7 +37,7 @@ static Arr* m_fillslice(Arr* p, B* ptr, usz ia) { return (Arr*)r; } static Arr* fillarr_slice (B x, usz s, usz ia) { return m_fillslice(a(x), c(FillArr,x)->a+s, ia); } -static Arr* fillslice_slice(B x, usz s, usz ia) { Arr* p = ptr_inc(c(Slice,x)->p); Arr* r = m_fillslice(p, c(FillSlice,x)->a+s, ia); dec(x); return r; } +static Arr* fillslice_slice(B x, usz s, usz ia) { Arr* p = ptr_inc(c(Slice,x)->p); Arr* r = m_fillslice(p, c(FillSlice,x)->a+s, ia); decG(x); return r; } static B fillarr_get (Arr* x, usz n) { assert(x->type==t_fillarr ); return inc(((FillArr* )x)->a[n]); } static B fillslice_get (Arr* x, usz n) { assert(x->type==t_fillslice); return inc(((FillSlice*)x)->a[n]); } @@ -145,13 +145,13 @@ B withFill(B x, B fill) { // consumes both B* rp = r->a; memcpy(rp, xp, ia*sizeof(B)); for (usz i = 0; i < ia; i++) inc(rp[i]); - dec(x); + decG(x); } } else { B* rp = r->a; SGet(x) for (usz i = 0; i < ia; i++) rp[i] = Get(x,i); - dec(x); + decG(x); } return taga(r); } diff --git a/src/core/harr.c b/src/core/harr.c index 2f56c6ca..bd0dda78 100644 --- a/src/core/harr.c +++ b/src/core/harr.c @@ -28,7 +28,7 @@ B toCells(B x) { } ptr_dec(csh); } - dec(x); + decG(x); return HARR_FV(r); } B toKCells(B x, ur k) { @@ -55,7 +55,7 @@ B toKCells(B x, ur k) { if (cr>1) ptr_dec(csh); usz* rsh = HARR_FA(r, k); if (rsh) for (i32 i = 0; i < k; i++) rsh[i] = xsh[i]; - dec(x); + decG(x); return HARR_O(r).b; } @@ -103,7 +103,7 @@ static Arr* m_hslice(Arr* p, B* ptr, usz ia) { return (Arr*)r; } static Arr* harr_slice (B x, usz s, usz ia) { return m_hslice(a(x), c(HArr,x)->a+s, ia); } -static Arr* hslice_slice(B x, usz s, usz ia) { Arr* p = ptr_inc(c(Slice,x)->p); Arr* r = m_hslice(p, c(HSlice,x)->a+s, ia); dec(x); return r; } +static Arr* hslice_slice(B x, usz s, usz ia) { Arr* p = ptr_inc(c(Slice,x)->p); Arr* r = m_hslice(p, c(HSlice,x)->a+s, ia); decG(x); return r; } static B harr_get (Arr* x, usz n) { assert(x->type==t_harr ); return inc(((HArr* )x)->a[n]); } static B hslice_get (Arr* x, usz n) { assert(x->type==t_hslice); return inc(((HSlice*)x)->a[n]); } diff --git a/src/core/harr.h b/src/core/harr.h index e6248fa7..0d54ebf3 100644 --- a/src/core/harr.h +++ b/src/core/harr.h @@ -59,7 +59,7 @@ static B harr_fc_impl(HArr_p p, B x) { VTY(p.b, t_harrPartial); static B harr_fcd_impl(HArr_p p, B x) { VTY(p.b, t_harrPartial); p.c->type = t_harr; arr_shCopy((Arr*)p.c, x); - dec(x); + decG(x); gsPop(); return p.b; } diff --git a/src/core/stuff.c b/src/core/stuff.c index a6de2b02..cc20f474 100644 --- a/src/core/stuff.c +++ b/src/core/stuff.c @@ -55,21 +55,21 @@ extern B rt_under, bi_before; static B rtUnder_c1(B f, B g, B x) { // consumes x B fn = m2_d(inc(rt_under), inc(f), inc(g)); B r = c1(fn, x); - dec(fn); + decG(fn); return r; } static B rtUnder_cw(B f, B g, B w, B x) { // consumes w,x B fn = m2_d(inc(rt_under), inc(f), m2_d(inc(bi_before), w, inc(g))); B r = c1(fn, x); - dec(fn); + decG(fn); return r; } B def_fn_uc1(B t, B o, B x) { return rtUnder_c1(o, t, x); } B def_fn_ucw(B t, B o, B w, B x) { return rtUnder_cw(o, t, w, x); } -B def_m1_uc1(Md1* t, B o, B f, B x) { B t2 = m1_d(tag(ptr_inc(t),MD1_TAG),inc(f) ); B r = rtUnder_c1(o, t2, x); dec(t2); return r; } -B def_m1_ucw(Md1* t, B o, B f, B w, B x) { B t2 = m1_d(tag(ptr_inc(t),MD1_TAG),inc(f) ); B r = rtUnder_cw(o, t2, w, x); dec(t2); return r; } -B def_m2_uc1(Md2* t, B o, B f, B g, B x) { B t2 = m2_d(tag(ptr_inc(t),MD2_TAG),inc(f),inc(g)); B r = rtUnder_c1(o, t2, x); dec(t2); return r; } -B def_m2_ucw(Md2* t, B o, B f, B g, B w, B x) { B t2 = m2_d(tag(ptr_inc(t),MD2_TAG),inc(f),inc(g)); B r = rtUnder_cw(o, t2, w, x); dec(t2); return r; } +B def_m1_uc1(Md1* t, B o, B f, B x) { B t2 = m1_d(tag(ptr_inc(t),MD1_TAG),inc(f) ); B r = rtUnder_c1(o, t2, x); decG(t2); return r; } +B def_m1_ucw(Md1* t, B o, B f, B w, B x) { B t2 = m1_d(tag(ptr_inc(t),MD1_TAG),inc(f) ); B r = rtUnder_cw(o, t2, w, x); decG(t2); return r; } +B def_m2_uc1(Md2* t, B o, B f, B g, B x) { B t2 = m2_d(tag(ptr_inc(t),MD2_TAG),inc(f),inc(g)); B r = rtUnder_c1(o, t2, x); decG(t2); return r; } +B def_m2_ucw(Md2* t, B o, B f, B g, B w, B x) { B t2 = m2_d(tag(ptr_inc(t),MD2_TAG),inc(f),inc(g)); B r = rtUnder_cw(o, t2, w, x); decG(t2); return r; } B def_decompose(B x) { return m_hVec2(m_i32(isCallable(x)? (isImpureBuiltin(x)? 1 : 0) : -1),x); } @@ -345,7 +345,7 @@ NOINLINE void print_fmt(char* p, ...) { B r = do_fmt(emptyCVec(), p, a); va_end(a); printRaw(r); - dec(r); + decG(r); } NOINLINE void thrF(char* p, ...) { va_list a; @@ -395,12 +395,12 @@ NOINLINE bool atomEqualR(B w, B x) { if (dcf == def_decompose) return false; B wd=dcf(inc(w)); B* wdp = harr_ptr(wd); B xd=dcf(inc(x)); B* xdp = harr_ptr(xd); - if (o2i(wdp[0])<=1) { dec(wd);dec(xd); return false; } + if (o2i(wdp[0])<=1) { decG(wd);decG(xd); return false; } usz wia = a(wd)->ia; - if (wia!=a(xd)->ia) { dec(wd);dec(xd); return false; } + if (wia!=a(xd)->ia) { decG(wd);decG(xd); return false; } for (u64 i = 0; iia; - if (wia!=a(xd)->ia) { dec(wd);dec(xd); return false; } + if (wia!=a(xd)->ia) { decG(wd);decG(xd); return false; } for (u64 i = 0; iia; - for (u64 i = 1; iia; SGetU(x) @@ -746,7 +746,7 @@ B bqn_merge(B x) { memcpy (rsh , a(x)->sh, xr *sizeof(usz)); if(xfr)memcpy(rsh+xr, a(xf)->sh, xfr*sizeof(usz)); } - dec(x); dec(xf); + decG(x); dec(xf); return taga(r); } @@ -774,7 +774,7 @@ B bqn_merge(B x) { memcpy (rsh , a(x)->sh, xr *sizeof(usz)); if (elSh)memcpy(rsh+xr, elSh, elR*sizeof(usz)); } - dec(x); + decG(x); return withFill(taga(ra),fill); } diff --git a/src/singeli/c/cmp.c b/src/singeli/c/cmp.c index f4550717..1c796c7b 100644 --- a/src/singeli/c/cmp.c +++ b/src/singeli/c/cmp.c @@ -50,20 +50,20 @@ FN_LUT(avx2, le, AS); if (we==el_MAX) goto end; \ w=tw; x=tx; \ } \ - AL(x); \ + AL(x); \ if (ria) lut_avx2_##PNAME##AA[we](rp, (u8*)tyany_ptr(L), (u8*)tyany_ptr(R), ria); \ - dec(w);dec(x); return r; \ - } else goto end; \ - } \ - AL(w); \ + decG(w);decG(x); return r; \ + } else goto end; \ + } \ + AL(w); \ if (ria) lut_avx2_##NAME##AS [we](rp, (u8*)tyany_ptr(w), x.u, ria); \ - else dec(x); \ - dec(w); return r; \ + else dec(x); \ + decG(w); return r; \ } else if (isArr(x)) { u8 xe = TI(x,elType); if (xe==el_B) goto end; AL(x); \ if (ria) lut_avx2_##RNAME##AS[xe](rp, (u8*)tyany_ptr(x), w.u, ria); \ - else dec(w); \ - dec(x); return r; \ - } \ + else dec(w); \ + decG(x); return r; \ + } \ if (isF64(w)&isC32(x)) return m_i32(FC); \ if (isC32(w)&isF64(x)) return m_i32(CF); \ end:; diff --git a/src/utils/bits.c b/src/utils/bits.c index eac58fcb..cf48b722 100644 --- a/src/utils/bits.c +++ b/src/utils/bits.c @@ -27,12 +27,12 @@ NOINLINE B bit_sel(B b, B e0, bool h0, B e1, bool h1) { else if (tM==el_i16) { i16* rp; r=m_i16arrc(&rp, b); for (usz i = 0; i < ia; i++) rp[i] = bitp_get(bp,i)? i1 : i0; } else if (tM==el_i32) { i32* rp; r=m_i32arrc(&rp, b); for (usz i = 0; i < ia; i++) rp[i] = bitp_get(bp,i)? i1 : i0; } else { f64* rp; r=m_f64arrc(&rp, b); for (usz i = 0; i < ia; i++) rp[i] = bitp_get(bp,i)? f1 : f0; } - dec(b); return r; + decG(b); return r; } else if (elChr(t0) && elChr(t1)) { B r; u32 u0 = o2cu(e0); u32 u1 = o2cu(e1); if (t0<=el_c8 & t1<=el_c8 ) { u8* rp; r=m_c8arrc (&rp, b); for (usz i = 0; i < ia; i++) rp[i] = bitp_get(bp,i)? u1 : u0; } else if (t0<=el_c16 & t1<=el_c16) { u16* rp; r=m_c16arrc(&rp, b); for (usz i = 0; i < ia; i++) rp[i] = bitp_get(bp,i)? u1 : u0; } else { u32* rp; r=m_c32arrc(&rp, b); for (usz i = 0; i < ia; i++) rp[i] = bitp_get(bp,i)? u1 : u0; } - dec(b); return r; + decG(b); return r; } HArr_p r = m_harrUc(b); SLOW3("bit_sel", e0, e1, b); @@ -42,5 +42,5 @@ NOINLINE B bit_sel(B b, B e0, bool h0, B e1, bool h1) { u64 c0 = ia-c1; incBy(e0,c0); incBy(e1,c1); - dec(b); return r.b; + decG(b); return r.b; } diff --git a/src/utils/each.c b/src/utils/each.c index b8fa66bf..eabbff5e 100644 --- a/src/utils/each.c +++ b/src/utils/each.c @@ -14,7 +14,7 @@ B eachd_fn(BBB2B f, B fo, B w, B x) { ur rm = wg? xr : wr; if (rM==0) { B r = f(fo, Get(w,0), Get(x,0)); - dec(w); dec(x); + decG(w); decG(x); return m_hunit(r); } if (rm && !eqShPrefix(a(w)->sh, a(x)->sh, rm)) thrF("Mapping: Expected equal shape prefix (%H ≡ ≢𝕨, %H ≡ ≢𝕩)", w, x); @@ -30,7 +30,7 @@ B eachd_fn(BBB2B f, B fo, B w, B x) { if (rw) for (usz i = 0; i < ria; i++) r.a[i] = f(fo, hmv(r,i), Get(x,i)); else for (usz i = 0; i < ria; i++) r.a[i] = f(fo, Get(w,i), hmv(r,i)); } - dec(rw? x : w); + decG(rw? x : w); return r.b; } @@ -47,7 +47,7 @@ B eachd_fn(BBB2B f, B fo, B w, B x) { else for (usz i = 0; i < min; i++) { B c=Get(w,i); for (usz j = 0; j < ext; j++) HARR_ADDA(r, f(fo, inc(c), Get(x,HARR_I(r)))); } } B rb = HARR_FC(r, bo); - dec(w); dec(x); + decG(w); decG(x); return rb; } @@ -83,12 +83,12 @@ B eachm_fn(BB2B f, B fo, B x) { // TODO definitely rewrite this. Probably still if (!q_i32(cr)) { rH = m_harr0c(x); for (usz j = 0; j < i; j++) rH.a[j] = m_i32(rp[j]); - dec(r); + decG(r); goto fallback; } rp[i] = o2iu(cr); } - dec(x); + decG(x); return r; } else if (TI(x,elType)==el_f64) { f64* xp = f64any_ptr(x); @@ -101,12 +101,12 @@ B eachm_fn(BB2B f, B fo, B x) { // TODO definitely rewrite this. Probably still if (!q_f64(cr)) { rH = m_harr0c(x); for (usz j = 0; j < i; j++) rH.a[j] = m_f64(rp[j]); - dec(r); + decG(r); goto fallback; } rp[i] = o2fu(cr); } - dec(x); + decG(x); return r; } else if (v(x)->type==t_fillarr) { B* xp = fillarr_ptr(a(x)); @@ -129,6 +129,6 @@ B eachm_fn(BB2B f, B fo, B x) { // TODO definitely rewrite this. Probably still fallback: rH.a[i++] = cr; for (; i < ia; i++) rH.a[i] = f(fo, Get(x,i)); - dec(x); + decG(x); return rH.b; } \ No newline at end of file diff --git a/src/utils/mut.h b/src/utils/mut.h index 7c0a42e1..668138a8 100644 --- a/src/utils/mut.h +++ b/src/utils/mut.h @@ -84,7 +84,7 @@ static B mut_fc(Mut* m, B x) { assert(m->fns->elType!=el_MAX); static B mut_fcd(Mut* m, B x) { assert(m->fns->elType!=el_MAX); Arr* a = m->val; arr_shCopy(a, x); - dec(x); + decG(x); return taga(a); } static Arr* mut_fp(Mut* m) { assert(m->fns->elType!=el_MAX); @@ -171,14 +171,14 @@ FORCE_INLINE B vec_join_inline(B w, B x) { u64 wsz = mm_size(v(w)); u8 wt = v(w)->type; // TODO f64∾i32, i32∾i8, c32∾c8 etc - if (wt==t_bitarr && BITARR_SZ( ria)ia=ria; bit_cpy(bitarr_ptr(w),wia,bitarr_ptr(x),0,xia); dec(x); return FL_KEEP(w,fl_squoze); } - if (wt==t_i8arr && TYARR_SZ(I8, ria)ia=ria; memcpy(i8arr_ptr (w)+wia, i8any_ptr (x), xia*1); dec(x); return FL_KEEP(w,fl_squoze); } - if (wt==t_i16arr && TYARR_SZ(I16,ria)ia=ria; memcpy(i16arr_ptr(w)+wia, i16any_ptr(x), xia*2); dec(x); return FL_KEEP(w,fl_squoze); } - if (wt==t_i32arr && TYARR_SZ(I32,ria)ia=ria; memcpy(i32arr_ptr(w)+wia, i32any_ptr(x), xia*4); dec(x); return FL_KEEP(w,fl_squoze); } - if (wt==t_c8arr && TYARR_SZ(C8, ria)ia=ria; memcpy(c8arr_ptr (w)+wia, c8any_ptr (x), xia*1); dec(x); return FL_KEEP(w,fl_squoze); } - if (wt==t_c16arr && TYARR_SZ(C16,ria)ia=ria; memcpy(c16arr_ptr(w)+wia, c16any_ptr(x), xia*2); dec(x); return FL_KEEP(w,fl_squoze); } - if (wt==t_c32arr && TYARR_SZ(C32,ria)ia=ria; memcpy(c32arr_ptr(w)+wia, c32any_ptr(x), xia*4); dec(x); return FL_KEEP(w,fl_squoze); } - if (wt==t_f64arr && TYARR_SZ(F64,ria)ia=ria; memcpy(f64arr_ptr(w)+wia, f64any_ptr(x), xia*8); dec(x); return FL_KEEP(w,fl_squoze); } + if (wt==t_bitarr && BITARR_SZ( ria)ia=ria; bit_cpy(bitarr_ptr(w),wia,bitarr_ptr(x),0,xia); decG(x); return FL_KEEP(w,fl_squoze); } + if (wt==t_i8arr && TYARR_SZ(I8, ria)ia=ria; memcpy(i8arr_ptr (w)+wia, i8any_ptr (x), xia*1); decG(x); return FL_KEEP(w,fl_squoze); } + if (wt==t_i16arr && TYARR_SZ(I16,ria)ia=ria; memcpy(i16arr_ptr(w)+wia, i16any_ptr(x), xia*2); decG(x); return FL_KEEP(w,fl_squoze); } + if (wt==t_i32arr && TYARR_SZ(I32,ria)ia=ria; memcpy(i32arr_ptr(w)+wia, i32any_ptr(x), xia*4); decG(x); return FL_KEEP(w,fl_squoze); } + if (wt==t_c8arr && TYARR_SZ(C8, ria)ia=ria; memcpy(c8arr_ptr (w)+wia, c8any_ptr (x), xia*1); decG(x); return FL_KEEP(w,fl_squoze); } + if (wt==t_c16arr && TYARR_SZ(C16,ria)ia=ria; memcpy(c16arr_ptr(w)+wia, c16any_ptr(x), xia*2); decG(x); return FL_KEEP(w,fl_squoze); } + if (wt==t_c32arr && TYARR_SZ(C32,ria)ia=ria; memcpy(c32arr_ptr(w)+wia, c32any_ptr(x), xia*4); decG(x); return FL_KEEP(w,fl_squoze); } + if (wt==t_f64arr && TYARR_SZ(F64,ria)ia=ria; memcpy(f64arr_ptr(w)+wia, f64any_ptr(x), xia*8); decG(x); return FL_KEEP(w,fl_squoze); } if (wt==t_harr && fsizeof(HArr,a,B,ria)ia = ria; B* rp = harr_ptr(w)+wia; @@ -199,7 +199,7 @@ FORCE_INLINE B vec_join_inline(B w, B x) { SGet(x) for (usz i = 0; i < xia; i++) rp[i] = Get(x, i); } - dec(x); + decG(x); return FL_KEEP(w,fl_squoze); // keeping fl_squoze as appending items can't make the smallest item smaller } } @@ -207,7 +207,7 @@ FORCE_INLINE B vec_join_inline(B w, B x) { MUTG_INIT(r); mut_copyG(r, 0, w, 0, wia); mut_copyG(r, wia, x, 0, xia); - dec(w); dec(x); + decG(w); decG(x); return mut_fv(r); } static inline bool inplace_add(B w, B x) { // consumes x if returns true; fails if fills wouldn't be correct