Dave Voutila
18988b5f94
Fix use of errno on OpenBSD.
2025-03-27 10:36:40 -04:00
gingerBill
539e9bd2e3
Merge pull request #4836 from laytan/fix-wrong-out-of-memory
...
fix wrong out of memory in edge cases, just try allocate from block for one source of truth
2025-03-20 17:20:26 +00:00
gingerBill
21a6648cde
Fix #4903
2025-03-03 15:16:50 +00:00
gingerBill
0781526b35
Merge pull request #4466 from Barinzaya/simd_extract_msbs
...
SIMD Extract MSbs/LSbs Intrinsics
2025-02-24 14:04:07 +00:00
Barinzaya
4afedbc051
Added simd_extract_lsbs intrinsic as well.
...
Equivalent to the simd_extract_msbs intrinsic, except it extracts the
least significant bit of each element instead.
2025-02-24 08:49:57 -05:00
gingerBill
ef016d957b
Add @(require_results) to random generator
2025-02-24 13:48:07 +00:00
Barinzaya
33a3aab791
Added simd_extract_msbs intrinsic.
2025-02-24 08:39:32 -05:00
gingerBill
614c0dd740
Fix typeid size for 32-bit platforms
2025-02-20 17:10:04 +00:00
gingerBill
4ece0617bc
Keep -vet happy
2025-02-20 14:18:19 +00:00
gingerBill
5489a88983
Change typeid definition to be based around the canonical type hash
...
`typeid` used to be a fancy index with extra metadata stored on it. Now it is direct hash of the type.
This is safe to do in practice since any possible collisions are checked at compile time AND the chances of having a 1% collision are around 1 in 600K (see the Birthday Paradox).
Therefore accessing a `^Type_Info` is now a hash table lookup with linear probing. The table is twice the size than necessary so prevent too much probing due to an overly dense hash table.
2025-02-20 14:10:45 +00:00
Laytan Laats
7df5be2131
fix wrong out of memory in edge cases, just try allocate from block for one source of truth
2025-02-12 19:09:21 +01:00
Barinzaya
98b3a9eacd
Added support for growing in place to some arenas.
...
This affects `runtime.Arena` and `virtual.Arena`, but not currently
`mem.Arena`. These changes allow the last allocation that has been
made to be resized to a larger size by just extending their
allocation in-place, when there's sufficient room in the memory block to
do so.
Shrinking in place and re-using the rest of the allocation can be
supported using almost the same logic, but would require the memory to
be zeroed. Since this would add a additional cost that isn't currently
present, shrinking has not been changed.
2025-01-24 10:13:46 -05:00
gingerBill
dde3a03022
Add priority_index to Foundation.framework import in base:runtime
2025-01-22 13:03:51 +00:00
Laytan Laats
4de5911a15
fix map_entry sometimes giving wrong key pointer
...
`map_desired_position` does not return the actual position, probing must
be done afterwards to figure out the real position. `map_entry` did not
do this for the returned key pointer so it could point to the wrong key
if probing was done.
2025-01-18 14:02:27 +01:00
alektron
a0c20023fc
Fix: Issue with non-zeroed memory after arena_temp_and;
...
Fix: total_used field of growing Arena was not decremented correctly in arena_temp_end;
2025-01-15 17:59:30 +01:00
gingerBill
98efb03934
Merge pull request #4599 from Barinzaya/fix_dynamic_resize_zeroing_on_grow
...
Fix dynamic array not zeroing when growing
2025-01-06 12:37:05 +00:00
gingerBill
a6f1046fc0
Merge pull request #4533 from laytan/map-entry
...
add `map_entry` procedure
2025-01-06 12:36:27 +00:00
gingerBill
f160ba4fa6
Merge pull request #4623 from Yawning/feature/rt-assert-ensure
...
base/runtime: Add `ensure` and `ensure_contextless`
2025-01-06 09:37:57 +00:00
Laytan
00afd53f46
Merge pull request #4654 from obiwan87/master
...
Minor adjustments in documentation-only files for better LSP support
2025-01-05 18:52:19 +01:00
Laytan
b98833ce04
spacing
2025-01-05 18:42:48 +01:00
Antonino Simone Di Stefano
ec1fefb3f5
Import "base:runtime" to resolve reference to type info correctly
2025-01-03 22:47:18 +01:00
Antonino Simone Di Stefano
630b1c5cdf
Remove typeid
...
seems to be a typo
2025-01-03 22:47:18 +01:00
Antonino Simone Di Stefano
d9165727f5
Make expect parameter polymorphic
2025-01-03 22:47:18 +01:00
Antonino Simone Di Stefano
6edb061061
Import "base:runtime" to make type references valid
2025-01-03 22:47:18 +01:00
fleandro
c93e096d8f
fix N=1 and cleanup tests
2025-01-03 16:50:05 +00:00
fleandro
e3de02eaa8
runtime: map_cell_index_static produced wrong results when the number of elements per cell was a power of 2
2025-01-03 15:33:34 +00:00
Yawning Angel
3a5440e4ed
base/runtime: Add ensure and ensure_contextless
...
This provides an equivalent to `assert` and `assert_contextless` that
are always evaluated, ignoring `ODIN_DISABLE_ASSERT`, which is useful
for enforcing API contracts or "asserting" on conditionals with
side-effects.
2024-12-25 00:08:09 +09:00
Barinzaya
5f46b5ca50
Fixed zeroing in resize_dynamic_array.
...
When a dynamic array has unused capacity and is resized to a size
greater than its capacity, the unused part of its capacity wasn't being
zeroed.
2024-12-19 17:52:09 -05:00
Laytan Laats
8050622fe6
add map_entry procedure
2024-11-28 20:07:54 +01:00
Jeroen van Rijn
56e4da8546
Fix #4509
2024-11-24 13:08:24 +01:00
Tetralux
2f85257bad
[runtime] make(map[K]V) should not allocate any capacity
...
`make(map[K]V)` was resolving to `make_map_cap()` which allocates initial capacity when it wasn't intended to.
It now calls `make_map()` which doesn't allocate any capacity.
Both `make(map[K]V)` and `make(map[K]V, allocator)` will NOT allocate initial capacity now.
2024-11-16 06:13:12 +00:00
gingerBill
e38a08013e
Remove #relative types from the compiler
2024-11-14 16:17:24 +00:00
Laytan Laats
10c2f8dbeb
math/rand: add choice_bit_set
2024-10-26 13:50:28 +02:00
Karl Zylinski
fd05d94789
Add make_map that just takes an allocator and no capacity, similar to make_dynamic_array. This renames the old make_map to make_map_cap.
2024-10-02 17:47:04 +02:00
mtarik34b
82aefd4203
Add documentation to runtime.container_of
2024-09-29 16:04:39 +02:00
gingerBill
b116e8ff55
Fix 128-bit integer support for wasm targets
2024-09-20 01:29:39 +01:00
gingerBill
290561a39b
Merge pull request #4270 from flysand7/heap-alloc-resize-fix
...
Fix resize OOB when copying old data that's bigger than new data
2024-09-19 12:57:18 +01:00
flysand7
bec09d82df
Fix vet errors
2024-09-19 21:07:08 +11:00
flysand7
e0bb07728d
Fix resize OOB when copying old data that's bigger than new data
2024-09-19 20:55:52 +11:00
Karl Zylinski
093ade0504
Merge branch 'master' into file-tags-without-comments
2024-09-17 19:36:17 +02:00
gingerBill
a16d3b6c9a
Merge pull request #4242 from laytan/caller-expression
...
add '#caller_expression'
2024-09-16 17:36:46 +01:00
Laytan Laats
603efa860a
add '#caller_expression'
2024-09-14 22:13:37 +02:00
Karl Zylinski
19f0127e55
Moved all packages in core, base, vendor, tests and examples to use new #+ file tag syntax.
2024-09-14 18:27:49 +02:00
flysand7
f16ed256ea
[mem]: Fix handling of default resize to check alignment
2024-09-11 08:00:27 +11:00
Franz Hoeltermann
02da1ac9af
Added #any_int directive to some more builtin slice/dynamic array
...
procedures
2024-09-03 12:36:32 +02:00
Franz Hoeltermann
b618b665c6
Added #any_int to some #soa procs to mirror the behaviour of their
...
non-soa counterparts
2024-09-03 11:46:09 +02:00
Damian Tarnawski
a10f988020
Move some types to runtime, use reflection instead of lut
2024-08-29 21:12:33 +02:00
Feoramund
d338642dc4
Add API for freeing thread_local state
2024-08-26 06:01:59 -04:00
gingerBill
d0eaf7642d
Add intrinsics.type_has_shared_fields
2024-08-24 14:36:18 +01:00
gingerBill
eb799393d5
Fix -vet-tabs issues
2024-08-24 13:56:41 +01:00