Brendan Hansknecht
0f708d7577
fix accessing bug
2023-03-15 10:06:31 -07:00
Brendan Hansknecht
88a69a23a8
fix type to work on 32bit platforms
2023-03-15 10:06:31 -07:00
Brendan Hansknecht
7f3c67ade9
use isValidUnicode in fromUtf8 to make it faster. Also fix off by one bug.
2023-03-15 10:06:31 -07:00
Brendan Hansknecht
f6677f3c1f
Add a fast path for validating ASCII charcters
...
From my quick testing using the code for testing this function in zig standard lib:
small ascii: 2.2x
small unicode: 0.9x
medium ascii: 15x
medium unicode: 1.01x
medium mix: 3.25x
large ascii: 32.8x
large unicode: 1.03x
large mixed: 3.35x
small being less than 8 bytes.
large being roughly greater than 512 bytes.
2023-03-15 10:06:31 -07:00
Brendan Hansknecht
1319ba4844
add List.releaseExcessCapacity builtin
2023-03-13 17:43:21 -07:00
Brendan Hansknecht
b94a046b0d
make sure to check raw capacity when decrementing refcounts
2023-03-13 14:08:24 -07:00
Brendan Hansknecht
dfb748fb03
misc cleanup + change refcount pointer to avoid branching
2023-03-13 14:08:24 -07:00
Brendan Hansknecht
216fd3f9f6
Update typo in comment
...
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
Signed-off-by: Brendan Hansknecht <Brendan.Hansknecht@gmail.com>
2023-03-13 14:08:24 -07:00
Brendan Hansknecht
5f6910f747
add todo about upgrading to bit manipulation
2023-03-13 14:08:24 -07:00
Brendan Hansknecht
f96a63c1d4
correct case for zig naming
2023-03-13 14:08:23 -07:00
Brendan Hansknecht
146dff5446
add llvm refcounting and fix memory leak
2023-03-13 14:08:23 -07:00
Brendan Hansknecht
7a927b6192
Port fromUtf8 to fromUtf8Range
...
All roc file calls already use fromUtf8Range.
Removed the duplicate function for simplicity.
Inlining should lead to generating the same code.
2023-03-13 14:08:23 -07:00
Brendan Hansknecht
cda37a5d1b
use seamless slices for List.dropAt when possible
2023-03-13 14:08:23 -07:00
Brendan Hansknecht
4ced1bcfdd
add baseline of seamless slices
2023-03-13 14:08:23 -07:00
Brendan Hansknecht
e32c5f6514
standardize on decref instead of deinit for name
2023-03-13 14:08:23 -07:00
Brendan Hansknecht
440c0518f1
Change list.deinit to take alignment directly
...
In doing so remove the many class directly to utils.decref
2023-03-13 14:08:22 -07:00
Brendan Hansknecht
e6964536b2
add more Num.bytesTo* functions
2023-03-12 08:41:05 -07:00
Brendan Hansknecht
785da377c8
add Num.count*Bits functions
2023-03-12 08:41:04 -07:00
Brendan Hansknecht
df8cc231eb
rustfmt
2023-03-10 13:57:11 -08:00
Brendan Hansknecht
cb191d3788
Split utils into error and command utils
...
Error utils pulls in snafu which requires procedural macros.
This means it can't start compiling until syn and macro related crates are compiled.
This deals compiling all crates that depend on commands like running zig for the bitcode.
The split enables those crates to run sooner.
2023-03-10 09:39:43 -08:00
Brendan Hansknecht
d5e191d083
split up bitcode building to reduce dependency chains
2023-03-10 09:39:43 -08:00
Brendan Hansknecht
0aa932d014
fix mem leak in Str.trim and make all Str.trim* functions consistent
2023-03-02 22:18:26 -08:00
Richard Feldman
b5caddcb77
Merge pull request #4973 from roc-lang/fix-string-split
...
fix string split on overlapping delimiters
2023-01-27 19:34:07 -05:00
Folkert
d52c037cba
fix string split on overlapping delimiters
2023-01-27 17:35:10 +01:00
Ayaz
99050956d3
Merge pull request #4971 from roc-lang/str-trim-null-byte
...
fix bug in Str.trim
2023-01-27 09:29:01 -06:00
Folkert
a77f137a9d
fix bug in Str.trim
2023-01-26 22:52:14 +01:00
Folkert
0af11c210e
fix memory leak in List.concat
2023-01-26 20:31:33 +01:00
Folkert
4e5b106f98
use capacity instead of length in list deinit
2023-01-20 21:44:41 +01:00
Folkert
165d4b3450
fix memory leak in string trimming
2023-01-19 14:35:38 +01:00
Folkert
437498b7ac
list decrement must use capacity, not length
2023-01-14 13:14:37 +01:00
Folkert
148d24662e
use capacity instead of length in decref
2023-01-08 22:01:35 +01:00
Folkert
05e23f8c5c
decref owned but empty list in List.concat
2022-12-29 00:13:24 +01:00
Folkert
2dfa7d6ef1
fix memory leak in List.concat
2022-12-28 22:52:32 +01:00
Folkert de Vries
3682e7db6c
Merge pull request #4796 from roc-lang/str-rc-fixes
...
fix missing decref in split and concat
2022-12-22 12:00:53 +01:00
Folkert
1481aea40c
fix missing decref in split and concat
2022-12-22 01:08:31 +01:00
Folkert
6c7d434f81
fix lifetime issue in RocStr.asU8Ptr
2022-12-21 01:43:38 +01:00
Folkert de Vries
a18197347b
Merge pull request #4767 from roc-lang/wasm_interp_repl_test
...
Replace Wasmer with roc_wasm_interp
2022-12-18 20:44:58 +01:00
Folkert
a522d49558
backport some changes needed for zig 10
2022-12-17 22:17:27 +01:00
Brian Carroll
62269bf6c9
builtins: build the Wasm interpreter from inside run-wasm-tests.sh
2022-12-16 16:05:00 +00:00
Brian Carroll
f55fbaad12
builtins: use roc_wasm_interp for Zig wasm tests
2022-12-14 12:09:31 +00:00
Brian Carroll
01d0c5fabc
Merge branch 'main' of github.com:roc-lang/roc into wasm_interp_test_gen
2022-12-14 11:15:42 +00:00
Brian Carroll
8c7d9dbff8
wasm_interp: Make ValueStack a dumb Vec<Value> => Zig test 146.3->124.6ms
2022-12-09 23:20:50 +00:00
Folkert
95fe9cbccd
pass the pointer to shared memory around, instead of using a global
2022-12-08 23:22:26 +01:00
Richard Feldman
5958f50728
Drop obsolete mentions of roc_send_signal
2022-12-08 06:36:12 -05:00
Folkert
3bae4145d9
do expect/dbg with atomics
2022-12-08 00:41:20 +01:00
Ayaz Hafiz
4df83d67ea
use copyBackwards when copying overlapping items in non-unique.unique concat
...
`mem.copy` requires that `dest` has start index `<= src`, but in our
case, `dest` has start index `>= src`. For this, `copyBackwards` should
be used.
See https://github.com/ziglang/zig/blob/master/lib/std/mem.zig#L195-L222 .
Closes #4697
2022-12-06 12:58:04 -06:00
Ayaz Hafiz
a549176886
Add reproduction of failing unique concat bug
2022-12-06 12:57:32 -06:00
Ayaz Hafiz
4202352b19
Update panic tags of builtins
2022-11-24 14:46:52 -06:00
Ayaz Hafiz
d7db10d7b5
Check in panic_utils.zig
2022-11-24 14:46:50 -06:00
Ayaz Hafiz
f29b85e244
Update builtins to use RocStr as panic type
2022-11-24 14:46:50 -06:00