Commit graph

198 commits

Author SHA1 Message Date
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
a522d49558
backport some changes needed for zig 10 2022-12-17 22:17:27 +01: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
Folkert
e7f3c6f281
inline dbg 2022-11-23 21:23:28 +01:00
Ayaz Hafiz
b6f53f22c3
Fix inline expects on macos
MacOS SIGUSR1 is signal 30, not 10 as it is on Linux.
At least on MacOS clang, we need the added headers to the c platform's
host to compile correctly.
2022-11-15 09:30:28 -06:00
Folkert
b6b7d186e4
make new extern functions compile on windows 2022-11-10 23:14:41 +01:00
Folkert
94cc2971a3
don't use a global on the zig side (surgical linking can't do those yet) 2022-11-05 14:08:19 +01:00
Folkert
b4878e5550
Merge remote-tracking branch 'origin/main' into roc-dev-inline-expects 2022-10-24 18:39:30 +02:00
Travis Staloch
c2dbed2ff5
str-graphemes: rework and add some zig tests
- rework strGraphemes() to use a mutable slice and keep track of just
`last_codepoint_len`.
- add zig tests for empty string, ascii, utf8, ascii+utf8+emoji
2022-10-22 19:29:49 -07:00
Prajwal S N
df7e4eea7e
builtin(str): implement Str.graphemes
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2022-10-22 19:29:49 -07:00
Folkert
ebac056814
Merge remote-tracking branch 'origin/main' into roc-dev-inline-expects 2022-10-21 23:05:34 +02:00
Brendan Hansknecht
9f09bebdca
run 2022-10-17 21:50:25 -07:00
Brendan Hansknecht
1225cb54fc
Fix memory leak in List.concat 2022-10-17 21:45:46 -07:00
Folkert
323210c547
Merge remote-tracking branch 'origin/main' into roc-dev-inline-expects 2022-10-16 13:56:30 +02:00
Folkert
d9f9183009
fix zig tests by providing new libc functions 2022-10-12 21:15:48 +02:00
Folkert
2b60cb1dcd
include process id in expect buffer name 2022-10-12 21:06:44 +02:00
Folkert
19ea3489cb
provide more libc functions for the expect implementation 2022-10-12 20:59:18 +02:00
Brendan Hansknecht
e551e59c1c
refactor string reallocation 2022-10-11 07:56:34 -07:00
Brendan Hansknecht
96b5d365b2
Add capacity growth to RocStr
Also, cleans up the alloc and realloc api for both list and str.
Updates Str.reserve to match List.reserve
2022-10-10 22:24:55 -07:00
Brendan Hansknecht
fdafac4323
Remove RocResult from utils.zig
It is implemented wrong and not used anywhere
2022-10-10 08:25:59 -07:00
Folkert
e62ab00c65
Merge remote-tracking branch 'origin/main' into roc-dev-inline-expects 2022-10-09 18:46:57 +02:00
Richard Feldman
5dafad506e
Merge pull request #4240 from roc-lang/list-growth
List growth
2022-10-08 23:58:49 -07:00
Brendan Hansknecht
aca6f2a8f1
add todo around improving performance 2022-10-08 07:53:50 -07:00
Brendan Hansknecht
8269986113
remove comment on zero width types.
They should not affect the normal case. It is better they affect the capacity calculation
2022-10-08 07:53:33 -07:00
Brendan Hansknecht
eca4682787
deal with zero element_width
That being said, this only affects wasm.
So wasm probably should be handling zero element lists in a smarter way.
2022-10-07 17:58:48 -07:00
Brendan Hansknecht
557ee69557
fix minor typo 2022-10-07 17:11:46 -07:00
Brendan Hansknecht
1665f7160d
Fix bug in reallocate 2022-10-07 17:11:33 -07:00
Prajwal S N
9013e4ce11
builtin(str): implement withCapacity
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2022-10-08 00:24:46 +05:30
Brendan Hansknecht
d06966392f
Add smarter list capacity growth calculations 2022-10-07 08:59:32 -07:00