Brendan Hansknecht
c6d594a758
cleanup constant refcount checking
2025-01-01 12:28:16 -08:00
Brendan Hansknecht
4b8693537a
Simplify Refcounting
...
Instead of -max_size to -1 for regular refcounts, use 1 to max_size.
0 still means constant refcount.
The highest bit is used to signify atomic refcounting required.
This does not turn on any sort of atomic refcounting.
2025-01-01 11:00:18 -08:00
Brendan Hansknecht
8ad6c47211
also update is_unique for atomic isize
2024-12-31 20:52:04 -08:00
Brendan Hansknecht
f901946455
Improve roc atomic refcounting by using first bit to indicate threadlocal
...
By avoiding atomic refcounting for any threadlocal variable, this greatly improves performance.
Leads to the performance of threadlocal refcounting being only ~4% behind non-atomic refcounting.
The old atomic refcounting could be as far as ~50% behind (though normally 10-20%).
This does not enable anything atomic related.
If we enable all forms of data loading (List.get, Box.unbox, loading recursive tag) to propagate the atomic flag,
this should be a reasonable implementation for roc by default.
With propagation, a platform would just set a list to atomic. On load, individual elements would also get set to atomic.
We also should probably revert back to threadlocal if an atomic refcount drops to 1.
2024-12-31 20:52:03 -08:00
Brendan Hansknecht
0a573ca557
Merge remote-tracking branch 'origin/main' into upgrade-llvm-zig
2024-12-11 16:38:34 -08:00
Mattthew Heath
3aeab753b4
tidying
2024-12-06 18:44:10 +00:00
Mattthew Heath
8c2cdeb332
aligns at 16 finally
2024-12-06 18:35:49 +00:00
Mattthew Heath
addd826511
Revert "aligns as 8"
...
This reverts commit 82a70c79b8
.
2024-12-06 17:47:08 +00:00
Mattthew Heath
82a70c79b8
aligns as 8
2024-12-06 17:33:12 +00:00
Mattthew Heath
b33f1b0981
aligns as usize
2024-12-06 17:16:24 +00:00
Brendan Hansknecht
a8dd6244e9
fix zig build errors
2024-07-28 15:55:37 +10:00
Luke Boswell
011c13fb17
fixup the obivous zig errors
2024-07-28 15:55:37 +10:00
Brendan Hansknecht
4e8f916204
correct pointer alignment on decref
2024-07-13 10:39:57 -07:00
Brendan Hansknecht
255cc31ad9
change zig bitcode refcounting to require whether or not an element is refcounted
...
This also requires zig bitcode to have access to the dec functions for elements.
This is needed so that zig will be able to free elements in lists.
2024-07-13 10:39:51 -07:00
Brendan Hansknecht
787d7f85ac
switch dbg arg ordering to make it backwards compatible
2023-12-02 21:18:32 -08:00
Brendan Hansknecht
3966d63e2f
add src and location to dbg
2023-12-02 21:18:31 -08:00
Brendan Hansknecht
b62c9667d5
Correct typo
...
Co-authored-by: Ayaz <20735482+ayazhafiz@users.noreply.github.com>
Signed-off-by: Brendan Hansknecht <Brendan.Hansknecht@gmail.com>
2023-11-29 21:05:49 -08:00
Brendan Hansknecht
e6cc43492a
rip out old dbg and setup reasonable base debug location info
2023-11-29 21:05:49 -08:00
Brendan Hansknecht
3d6c140a30
get minimal roc_dbg
working
2023-11-29 21:05:49 -08:00
Brendan Hansknecht
ca283197b9
fix LIST_RELEASE_EXCESS_CAPACITY arg count
2023-10-23 13:50:34 -07:00
Folkert
ec0eddb8b2
fix bug in use of alignment in free for tag unions
2023-10-23 13:50:34 -07:00
Brendan Hansknecht
f1126aae75
correct type of bytes_or_null to allow it to be aligned to 1 instead of 8
2023-10-23 13:50:34 -07:00
Brendan Hansknecht
2e2e609547
update zig to 0.11 and update build script
...
Also update memcpy to avoid recursive memcpy due to optimizations.
2023-10-23 13:50:30 -07:00
Folkert
5ebd18cee0
trim some debug messages
2023-09-14 14:43:29 +02:00
Folkert
fdacfce108
all gen-dev tests work again
2023-09-14 14:43:28 +02:00
Folkert
5e4f43e1d8
checkpoint
2023-09-14 14:43:24 +02:00
Folkert
3c8dbce72e
fix alignment bug in list literals
2023-09-14 14:39:15 +02:00
Folkert
3909443ef4
fix two bugs in the dev backend
2023-09-13 20:24:17 +02:00
Luke Boswell
2e0c83ae63
fixes for zig tests Windows
2023-09-12 19:28:11 +10:00
Folkert
f04295863d
reuse free'ing logic
2023-06-27 19:37:22 +02:00
Folkert
fc3004da58
free or reuse unconditionally when value is unique
2023-06-27 17:37:45 +02:00
Brendan Hansknecht
60e70c6b1b
add workaround for wasm tests
2023-06-02 15:23:06 -07:00
Brendan Hansknecht
75a035e12d
remove all definitions of roc_memcpy
2023-06-02 15:23:05 -07:00
Folkert
f6fafdb019
nullable unwrapped for the dev backend
2023-06-01 00:02:38 +02:00
Brendan Hansknecht
90636d14c8
add extra note on security
2023-05-26 07:31:35 -07:00
Brendan Hansknecht
b4c359588e
Seed Dict and Set
...
This changes Dict and Set to have a compilation depedent seed.
The seed is not exposed to userland in anyway.
This gets a much more DOS resistant Dict and Set with no cost.
2023-05-25 09:55:48 -07:00
Folkert
317a8880c1
better debug info if dec on invalid pointer
2023-05-14 18:01:47 +02:00
Folkert
dd8739b847
better debug info if inc on invalid pointer
2023-05-14 15:20:43 +02:00
Folkert
278e2c4604
use std.debug.print
2023-05-03 14:30:03 +02:00
Folkert
85fcd71bdb
use bitcast instead of intcast
2023-05-03 14:28:22 +02:00
Folkert
05a9b4d601
fix that inc on list was no longer recursive
2023-05-03 01:03:09 +02:00
Folkert de Vries
a5a91d428f
Merge pull request #5336 from roc-lang/dev-backend-list-map
...
dev backend: many more builtins
2023-05-01 10:20:15 +02:00
Folkert
cf54304cf4
add lowlevel to inc/dec a data pointer
2023-04-28 15:30:23 +02:00
Folkert
c6c28e7c5d
implement Crash
2023-04-27 00:29:21 +02:00
J.Teeuwissen
74f2b0afda
Updated refcount logic
2023-04-26 18:14:16 +02:00
J.Teeuwissen
ed46a1f2cb
lowlevel isUnique
2023-04-26 17:23:10 +02:00
Folkert
a522d49558
backport some changes needed for zig 10
2022-12-17 22:17:27 +01:00
Richard Feldman
5958f50728
Drop obsolete mentions of roc_send_signal
2022-12-08 06:36:12 -05:00
Ayaz Hafiz
f29b85e244
Update builtins to use RocStr as panic type
2022-11-24 14:46:50 -06:00
Folkert
b6b7d186e4
make new extern functions compile on windows
2022-11-10 23:14:41 +01:00