75 Commits

Author SHA1 Message Date
Tejas Hegde
d27f34f233 Updated delete_key doc to mention iteration behaviour 2026-03-30 19:29:52 +10:30
WojtaZam
1f9f2dc0da fix Error: Missing return statement at the end of the procedure pop_fixed_capacity_dynamic_array 2026-03-17 20:19:46 +01:00
Shane Shrybman
af2d8ca679 FCD array proc group add _elems 2026-03-15 21:45:44 -04:00
gingerBill
ad1a10b8af use intrinsics.mem_copy instead of a for-loop 2026-03-15 11:48:49 +00:00
gingerBill
310def1e71 Fix append_fixed_capacity_elems 2026-03-15 11:42:24 +00:00
gingerBill
c6772dfd06 Merge branch 'master' into bill/fixed-capacity-dynamic-array 2026-03-15 11:41:01 +00:00
Jeroen van Rijn
27667ce36b iff -> if and only if (⟺) 2026-03-13 11:54:15 +01:00
gingerBill
c7308d86d4 Fix tests as they are not direct matches to small_array 2026-03-12 17:33:54 +00:00
gingerBill
26eb58b589 Move raw closer to usage 2026-03-12 17:03:07 +00:00
gingerBill
6c61b1d46c Remove loc being passed 2026-03-12 16:59:58 +00:00
gingerBill
fac8471019 Fix typos 2026-03-12 16:59:11 +00:00
gingerBill
6e9d6bfbe5 Fixed tests 2026-03-12 16:55:46 +00:00
gingerBill
6a03cf5d68 Add "remove" procedures to fixed capacity dynamic arrays 2026-03-12 09:40:31 +00:00
gingerBill
535b70b82e Add other @builtin procedures for fixed capacity dynamic arrays 2026-03-12 09:37:27 +00:00
gingerBill
f1dbe9c242 [dynamic; N]T proof of concept: fixed capacity dynamic array (akin to small_array.Small_Array(N, T)) 2026-03-11 16:46:33 +00:00
Gavin Rohrer
93b1e97402 fix documentation of assign_at 2026-03-07 10:07:15 -05:00
Shane Shrybman
a0c375dd02 A small optimization for dynamic arrays.
Move assert(a.allocator.procedure != nil) out of the common path into the if check
2026-02-23 11:21:07 -05:00
Laytan
792e6c75ee Merge branch 'master' into nbio 2026-01-13 21:29:41 +01:00
Faker-09
9d72025a0b Remove duplicate assingment of array.allocator = allocator in _make_dynamic_array_len_cap(...) (#6095) 2026-01-13 21:25:17 +01:00
Laytan Laats
d1fa640549 runtime: use alloc_non_zeroed in new_clone; zeroing is not needed 2026-01-11 20:21:25 +01:00
Sylphrena
205bead9d2 Add @builtin to missing builtin procedure group procs 2025-12-19 15:57:25 +01:00
gingerBill
d343afbad5 Improve core_builtin.odin docs 2025-10-07 10:34:48 +01:00
gingerBill
9b4c0ea492 Type erase the internals of runtime.copy_* 2025-09-29 15:12:55 +01:00
gingerBill
286e3eafe6 Change inlining semantics for some builtin calls 2025-09-25 08:55:03 +01:00
gingerBill
4d2854f561 Merge pull request #5632 from kalsprite/x386
windows i386 support
2025-09-18 22:01:14 +01:00
gingerBill
9cf69576ab More improvements to minimize code gen size 2025-09-18 20:58:24 +01:00
gingerBill
3954491393 Type erasure to minimize code generation size 2025-09-18 15:54:05 +01:00
Jon Lipstate
57bc45ae30 revert to working build 2025-09-03 22:51:28 -07:00
Jon Lipstate
e0c4c53362 add tls when we have crt 2025-09-03 22:32:33 -07:00
Jon Lipstate
231ce2da59 windows i386 support 2025-08-29 12:41:38 -07:00
Harold Brenes
9d8e15b3af Implementes the block ABI.2010.3.16 natively via the objc_block intrinsic and the Objc_Block builtin type.
See: https://clang.llvm.org/docs/Block-ABI-Apple.html
2025-08-06 20:27:31 -04:00
gingerBill
2561427dd3 Add string16 and cstring16 (UTF-16 based strings) 2025-08-02 11:00:15 +01:00
Feoramund
61f9fb7232 runtime: Remove unneeded max(0, ...)
`len` never returns negative numbers, so this was an overcautious
expression.
2025-06-13 12:09:10 -04:00
Feoramund
91111937a7 Guard against negative index in inject_at
Fixes #4595
2025-06-04 13:58:06 -04: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
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
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
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
Laytan Laats
603efa860a add '#caller_expression' 2024-09-14 22:13:37 +02:00
Franz Hoeltermann
02da1ac9af Added #any_int directive to some more builtin slice/dynamic array
procedures
2024-09-03 12:36:32 +02:00
gingerBill
78fa675c1a Add assert_contextless, panic_contextless, unimplemented_contextless 2024-08-14 11:18:24 +01:00
Laytan Laats
26fa3aca44 fix copy-paste error in make docs 2024-08-11 17:09:26 +02:00
gingerBill
196ac7e6d6 Type erase _make_dynamic_array_len_cap 2024-07-15 00:01:26 +01:00
gingerBill
26a9416a41 Minor clean ups 2024-07-14 23:33:35 +01:00
gingerBill
e768bddaeb Inline _append_elem_string further 2024-07-14 23:22:22 +01:00