fix •file.MapBytes

This commit is contained in:
dzaima 2024-08-23 04:20:44 +03:00
parent 09bdeb7fd8
commit 79b0bda0d3
4 changed files with 12 additions and 11 deletions

View File

@ -830,7 +830,7 @@ B select_rows_direct(B x, ux csz, ux cam, void* inds, ux indn, u8 ie) { // ⥊ (
generic_int:;
assert(ie!=el_bit && generic_allowed);
B indo = taga(arr_shVec(m_tyslice(inds, a(emptyIVec()), ie, indn)));
B indo = taga(arr_shVec(m_tyslice(inds, a(emptyIVec()), t_i8arr + ie-el_i8, indn)));
return select_cells_base(indo, x, csz, cam);
decG_ret:;

View File

@ -96,9 +96,9 @@ SHOULD_INLINE u8 kCellWidthLog(B x, ur k) {
}
SHOULD_INLINE u8 cellWidthLog(B x) { return kCellWidthLog(x, 1); }
static Arr* m_tyslice(void* data, Arr* parent, u8 eltype, ux ia) {
assert(eltype!=el_bit && eltype!=el_B);
Arr* a = m_arr(sizeof(TySlice), t_i8slice + eltype-el_i8, ia);
static Arr* m_tyslice(void* data, Arr* parent, u8 type, ux ia) {
assert(IS_ANY_ARR(type) && IS_SLICE(type));
Arr* a = m_arr(sizeof(TySlice), type, ia);
((TySlice*) a)->p = parent;
((TySlice*) a)->a = data;
return a;

View File

@ -1,4 +1,4 @@
# not tested here: •Out •Show •Exit •GetLine •Cmp •CurrentError •FFI •internal.HeapDump •file.MapBytes
# not tested here: •Out •Show •Exit •GetLine •Cmp •CurrentError •FFI •internal.HeapDump
%DEF var V•internal.Variation LV•internal.ListVariations CLR•internal.ClearRefs
%DEF tvar %USE var _tvar {F _𝕣 x: (CLR@) {F 𝕩 V x}¨ LV 𝕩; w F _𝕣 x: (CLR@) (LV 𝕨) {(𝕨 V w) F 𝕩 V x} LV 𝕩}
@ -129,6 +129,7 @@ f←•ReBQN{primitives⇐⋈'÷'‿- ⋄ system⇐⟨"primitives", "foo"‿⋈,
•FChars "testfile.bqn" %% "abc"(@+10)"def𝕩"
•FBytes "testfile.bqn" %% @+97989910100101102240157149169
•FLines "testfile.bqn" %% "abc""def𝕩"
! 97989910100101102240157149169 @-˜ •file.MapBytes "testfile.bqn"
•file.Name "testfile3B.bqn" •file.Rename "testfile3.bqn" %% "testfile3B.bqn"
!"•file.Rename: Failed to rename file" % "testfile3B.bqn" •file.Rename "testfile.bqn"

View File

@ -1,6 +1,6 @@
!"Out of memory" % a(220) 1e9 {𝕊: a}˘ a
!"⥊: 𝕨 too large" % a(220) 1e9 a˘ a
!"Out of memory" % (225)/(210)10
!"Out of memory" % k16384 nk÷˜232 (nk) / n1
!"Out of memory" % k64 nk÷˜232 (nk) / n1 # %SLOW
!"Out of memory" % ˜31 2 # %SLOW
!"Out of memory" % a(220) 1e9 •internal.Keep {𝕊: a}˘ a
!"⥊: 𝕨 too large" % a(220) 1e9 •internal.Keep a˘ a
!"Out of memory" % •internal.Keep (225)/(210)10
!"Out of memory" % k16384 nk÷˜232 •internal.Keep (nk) / n1
!"Out of memory" % k64 nk÷˜232 •internal.Keep (nk) / n1 # %SLOW
!"Out of memory" % •internal.Keep ˜31 2 # %SLOW