Commit Graph
100 Commits
Author SHA1 Message Date
Jeroen van RijnandGitHub 4329f50d26 Merge pull request #5188 from deadwanderer/master
[vendor:directx/d3d12] Fix RESOURCE_STATE_ALL_SHADER_RESOURCE flags and add new HEAP_TYPE
2025-05-20 22:55:06 +02:00
Jeroen van RijnandGitHub 714066d91b Merge pull request #5186 from Kelimion/restore-cursor
Restore console mode when test runner exits.
2025-05-20 17:06:14 +02:00
Jeroen van Rijn 8bffd247b7 Restore console mode when test runner exits. 2025-05-20 16:51:24 +02:00
Jeroen van RijnandGitHub 50fcbb1058 Merge pull request #5183 from Feoramund/fix-5083
Do not call disabled deferred procedures
2025-05-20 02:58:38 +02:00
Jeroen van RijnandGitHub 91d6e5372c Merge pull request #5182 from Kelimion/dynamic-literals
-dynamic-literals
2025-05-19 20:53:23 +02:00
Jeroen van Rijn ab95932502 -dynamic-literals 2025-05-19 20:44:27 +02:00
Jeroen van RijnandGitHub b7783cac05 Merge pull request #5181 from Feoramund/fix-5167
Make `odin help` more precise
2025-05-19 15:38:09 +02:00
Jeroen van Rijn 558eca8c7a Merge branch 'master' of github.com:odin-lang/Odin 2025-05-18 15:08:21 +02:00
Jeroen van Rijn 1b13152286 Change XAudio2 DLL search flags to DEFAULT_DIRS 2025-05-18 15:08:10 +02:00
Jeroen van Rijn d6210ae76f Fix -vet complaints in core:sys/darwin/Foundation 2025-05-17 16:36:10 +02:00
Jeroen van Rijn 7c80df4830 @(init), @(fini) and @(export) procedures are classified as used.
For the purposes of `-vet-unused-procedures`, exported procedures and `@(init)` and `@(fini)` are now disregarded.
2025-05-17 16:22:47 +02:00
Jeroen van Rijn 25c935c305 Re-enable demo on *nix 2025-05-13 18:46:55 +02:00
Jeroen van RijnandGitHub 1a58476c03 Merge pull request #5155 from Kelimion/date_from_git
Parse odin version date out of HEAD commit if available
2025-05-13 18:45:16 +02:00
Jeroen van Rijn ed56a7ca10 Parse odin version date out of HEAD commit if available 2025-05-13 18:09:30 +02:00
Jeroen van RijnandGitHub 7cd00483fe Merge pull request #5154 from Kelimion/os2-rollback
Revert "os2: Don't try to translate Windows file attributes to Unix m…
2025-05-12 23:41:25 +02:00
Jeroen van Rijn d7a83a7a1f Revert "os2: Don't try to translate Windows file attributes to Unix mode flags"
This reverts commit 95923c2059.
It'll be updated later.
2025-05-12 23:34:12 +02:00
Jeroen van RijnandGitHub 8809ce2925 Merge pull request #5152 from Kelimion/mmap-flags
Update `linux.Map_Flags_Bits`
2025-05-12 17:23:39 +02:00
Jeroen van Rijn be24feb862 Move things to constants.odin 2025-05-12 17:13:59 +02:00
Jeroen van Rijn dec3d6959d Update linux.Map_Flags_Bits
Fixes #5151

- Removes `SHARED_VALIDATE` from the enum and turns it into `Map_Shared_Validate :: Map_Flags{.SHARED, .PRIVATE}` so it has the proper value of 0x03.
- Adds `DROPPABLE`.
- Adds constants `MAP_HUGE_SHIFT` and `MAP_HUGE_MASK`.
- Adds the huge page precomputed constants from `mman.h`, defined as the log2 of the size shifted left by `MAP_HUGE_SHIFT`:
	Map_Huge_16KB
	Map_Huge_64KB
	Map_Huge_512KB
	Map_Huge_1MB
	Map_Huge_2MB
	Map_Huge_8MB
	Map_Huge_16MB
	Map_Huge_32MB
	Map_Huge_256MB
	Map_Huge_512MB
	Map_Huge_1GB
	Map_Huge_2GB
	Map_Huge_16GB
2025-05-12 16:45:51 +02:00
Jeroen van Rijn 39789bc6cb Make strings.to_cstring adhere to #optional_allocator_error 2025-05-12 01:17:34 +02:00
Jeroen van RijnandGitHub f6a39ca675 Merge pull request #5148 from Kelimion/fix-clean-path
Fix os2.clean_path on Windows
2025-05-11 15:44:40 +02:00
Jeroen van Rijn 30388cada3 Fix os2.clean_path on Windows 2025-05-11 15:35:52 +02:00
Jeroen van Rijn e3fe733a55 Fix #5139 2025-05-09 19:45:46 +02:00
Jeroen van Rijn 3adade2639 Add .rdi RadDbg files to .gitignore 2025-05-09 19:42:54 +02:00
Jeroen van Rijn 8097b59e30 Also allow comparing SOA pointers against each other
This compares the data pointer *and* the index.

```odin
package scratch

import "core:fmt"

Foo :: struct {a, b: int}

main :: proc() {
    a := new(#soa[dynamic]Foo)
    a^ = make(#soa[dynamic]Foo, 12, 12)

    b := new(#soa[dynamic]Foo)
    b^ = make(#soa[dynamic]Foo, 12, 12)

    fmt.printfln("&a[0]: %p, &b[0]: %p, Same: %v", &a[0], &b[0], &a[0] == &b[0]) // Same: false
    fmt.printfln("&a[0]: %p, &b[0]: %p, Same: %v", &a[0], &b[1], &a[0] == &b[1]) // Same: false
    fmt.printfln("&a[0]: %p, &b[0]: %p, Same: %v", &a[0], &b[2], &a[0] == &b[2]) // Same: false

    fmt.printfln("&a[0]: %p, &a[1]: %p, Same: %v", &a[0], &a[1], &a[0] == &a[1]) // Same: false
    fmt.printfln("&a[1]: %p, &a[2]: %p, Same: %v", &a[1], &a[2], &a[1] == &a[2]) // Same: false
    fmt.printfln("&a[2]: %p, &a[3]: %p, Same: %v", &a[2], &a[3], &a[2] == &a[3]) // Same: false

    fmt.printfln("&a[0]: %p, &a[0]: %p, Same: %v", &a[0], &a[0], &a[0] == &a[0]) // Same: true
    fmt.printfln("&a[1]: %p, &a[1]: %p, Same: %v", &a[1], &a[1], &a[1] == &a[1]) // Same: true
    fmt.printfln("&a[2]: %p, &a[2]: %p, Same: %v", &a[2], &a[2], &a[2] == &a[2]) // Same: true
}
```
2025-05-06 15:10:08 +02:00
Jeroen van RijnandGitHub 9a8cc2d1e7 Merge pull request #5123 from bogwi/bug/5104
Bug/5104
2025-05-06 11:57:04 +02:00
Jeroen van Rijn 8032db3484 Fix CreateDibSection binding 2025-05-05 23:23:39 +02:00
Jeroen van Rijn 2224911aca Fix type_union_tag_offset when all members are zero sized 2025-05-05 18:09:54 +02:00
Jeroen van Rijn 32cef4c11b Fix change_times on Windows and simplify time handling in stat 2025-05-04 22:55:27 +02:00
Jeroen van RijnandGitHub 1ce3a9f766 Merge pull request #5114 from Kelimion/os2-fixes
os2: Don't try to translate Windows file attributes to Unix mode flags
2025-05-04 20:21:44 +02:00
Jeroen van Rijn 95923c2059 os2: Don't try to translate Windows file attributes to Unix mode flags
Also, fix `chmod`. It passed the wrong struct size to `SetFileInformationByHandle`.
2025-05-04 20:03:07 +02:00
Jeroen van Rijn 0f2a4b80ef Proper fix for executable name on Linux. 2025-05-04 01:05:10 +02:00
Jeroen van Rijn deededfb0a Fix executable_path info on Linux 2025-05-04 00:21:20 +02:00
Jeroen van Rijn c96d8237ba Clarify error messages for types that aren't simply comparable.
Previously, it implied that these are different types:
```
W:/Scratch/scratch.odin(17:5) Error: Cannot compare expression, operator '==' not defined between the types 'Handle_Map($T=u32, $HT=u32, $Max=10000)' and 'Handle_Map($T=u32, $HT=u32, $Max=10000)'
    if m == {} {
       ^~~~~~^
```
Now:
```
W:/Scratch/scratch.odin(20:5) Error: Cannot compare expression. Type 'Handle_Map($T=u32, $HT=u32, $Max=10000)' is not simply comparable, so operator '==' is not defined for it.
	if m == {} {
	   ^~~~~~^
```
2025-05-03 22:31:01 +02:00
Jeroen van Rijn 9681d88cd3 Fix #5107
Fixes #5107 by checking whether `result_count` is non-zero before indexing `type->Proc.results->Tuple.variables`.
2025-05-03 14:42:20 +02:00
Jeroen van Rijn 30c6fea9e9 Allow polymorphic #simd array as return type 2025-05-02 15:38:43 +02:00
Jeroen van RijnandGitHub 7027d37596 Merge pull request #5103 from jasonKercher/better-box2d-build
Make build_box2d.sh more flexible
2025-05-02 04:57:58 +02:00
Jeroen van RijnandGitHub 2d8ae2d23c Merge pull request #5100 from herohiralal/patch-1
Convention-related changes in `file_windows.odin`
2025-04-30 22:27:59 +02:00
Jeroen van RijnandGitHub b04a83ce9f Merge pull request #5096 from jdennis9/master
os2: Fix reading directory on Windows sometimes failing to decode a file name following one with exotic unicode characters
2025-04-30 12:10:09 +02:00
Jeroen van RijnandGitHub 7c294a6e55 Merge pull request #5090 from Barinzaya/cbor-fix-unmarshal-slice-overflow
Fixed CBOR Slice Overflow
2025-04-29 14:34:16 +02:00
Jeroen van Rijn 4f00224dd2 Add cbor.unmarshal_from_bytes taking a []byte 2025-04-29 01:10:15 +02:00
Jeroen van Rijn 8c47d42394 Fix lru.remove 2025-04-29 00:14:46 +02:00
Jeroen van RijnandGitHub 26f1cb493e Merge pull request #5087 from elyalon/typo
Fix typo in private function
2025-04-28 21:25:10 +02:00
Jeroen van Rijn d463aba7d1 Warn if someone imports the same case-folded path twice 2025-04-27 14:32:26 +02:00
Jeroen van RijnandGitHub 7d4c3d23e6 Merge pull request #5079 from herohiralal/master
Pipe size on windows.
2025-04-26 23:05:16 +02:00
Jeroen van RijnandGitHub cfb478808e Merge pull request #5074 from Barinzaya/time-tick-add
Add `tick_add` proc to `core:time`
2025-04-24 15:28:58 +02:00
Jeroen van Rijn 47f889569f Fix float64_range example 2025-04-21 18:37:57 +02:00
Jeroen van Rijn ab5ca087a7 Add comment 2025-04-19 23:44:02 +02:00
Jeroen van RijnandGitHub 062a3c2fae Fix parsing of CDATA tags (#5059)
Fixes #5054
2025-04-19 20:25:44 +02:00
Jeroen van RijnandGitHub bc86b50392 Replace default_tcp_options with constant (#5056)
Replace `default_tcp_options` with constant
2025-04-19 14:32:59 +02:00
Jeroen van RijnandGitHub d10cb91e3f Merge pull request #5053 from fendevel/fix/sdl3-display-binding
SDL3: Fix `count` output parameter of `GetFullscreenDisplayModes`
2025-04-18 19:45:45 +02:00
Jeroen van Rijn 07c59cb4db Early out and propagate nil in create*
If allocation of a `^Thread` failed, `create*` now properly return `nil`,
so you can assert on that instead of calling `thread.destroy` on a null pointer, say.
2025-04-17 17:26:24 +02:00
Jeroen van Rijn 1c655b84e4 Fix #5049
Keep in mind that `thread.create` needs an allocator to be set, as it returns `^Thread`.
2025-04-17 16:53:07 +02:00
Jeroen van RijnandGitHub 8985d3beb3 Merge pull request #5050 from Kelimion/pq-err
Let `core:container/priority_queue` return `runtime.Allocator_Error`
2025-04-17 14:35:04 +02:00
Jeroen van Rijn 5a39013339 Let core:container/priority_queue return runtime.Allocator_Error
`init`, `reserve` and `push` now return `runtime.Allocator_Error`.
2025-04-17 14:20:03 +02:00
Jeroen van RijnandGitHub 81274a7d67 Merge pull request #5045 from laytan/fix-not-resolving-to-alias-in-a-recursive-declaration
fix not resolving to alias in a recursive declaration
2025-04-16 23:07:01 +02:00
Jeroen van RijnandGitHub 3ba9b9b14e Merge pull request #5044 from Barinzaya/box2d-missing-allowfastrotation
Add missing field in box2d.BodyDef
2025-04-16 21:56:22 +02:00
Jeroen van Rijn 678fa897f5 signbit -> sign_bit in tests/core/math 2025-04-15 16:20:49 +02:00
Jeroen van Rijn ddedddc16d Get rid of duplicate math.signbit in favor of math.sign_bit 2025-04-15 16:17:02 +02:00
Jeroen van RijnandGitHub 2d5b85f9f9 Merge pull request #5038 from mtarik34b/noteq-comparison-for-nan-must-be-true
Ensure `NaN != any_float_value` evaluates to true for constant NaN values
2025-04-15 12:29:17 +02:00
Jeroen van Rijn 0fc141db5d core:mem/tlsf: Add early-out in OOM logic
This implementation doesn't allow for out-of-band allocations to be passed through, as it's not designed to
track those. Nor is it able to signal those allocations then need to be freed on the backing allocator,
as opposed to regular allocations handled for you when you `destroy` the TLSF instance.

So if we're asked for more than we're configured to grow by, we can fail with an OOM error early, without adding a new pool.
2025-04-14 20:40:05 +02:00
Jeroen van Rijn 3d13beb3ec Remove now-implemented TODO 2025-04-14 20:09:55 +02:00
Jeroen van RijnandGitHub 11af4cebb7 Merge pull request #5037 from Kelimion/tlsf
Allow `core:mem/tlsf` to automatically add new pools.
2025-04-14 20:00:39 +02:00
Jeroen van Rijn beee27dec0 Allow core:mem/tlsf to automatically add new pools.
New features:
- If TLSF can't service an allocation made on it, and it's initialized with `new_pool_size` > 0, it will ask the backing allocator for additional memory.

- `estimate_pool_size` can tell you what size your initial (and `new_pool_size`) ought to be if you want to make `count` allocations of `size` and `alignment`, or in its other form, how much backing memory is needed for `count` allocations of `type` and its corresponding size and alignment.
2025-04-14 19:49:55 +02:00
Jeroen van RijnandGitHub 66d99c1be3 Merge pull request #5036 from Kelimion/tlsf
Refactor `core:mem/tlsf`, add `free_all` support.
2025-04-14 17:30:46 +02:00
Jeroen van Rijn 7088284ff4 Refactor core:mem/tlsf, add free_all support.
TODO: Allow the TLSF allocator to add additional pools when it would ordinarily OOM
      by calling its backing allocator.
2025-04-14 17:13:27 +02:00
Jeroen van RijnandGitHub 9516084e58 Merge pull request #5035 from Sojamann/sync_chan-maintainance
core:sync/chan: maintainance and package clarity
2025-04-13 23:13:07 +02:00
Jeroen van RijnandGitHub a98cbe2cc9 Merge pull request #5034 from Kelimion/yeet-tuple
Remove Type_Info_Tuple
2025-04-13 21:59:32 +02:00
Jeroen van Rijn bb38775fb1 Remove Type_Info_Tuple 2025-04-13 21:51:57 +02:00
Jeroen van RijnandGitHub c10cf312ff Merge pull request #5032 from Sojamann/sync_chan-doc
core:sync/chan: add package documentation
2025-04-13 17:09:18 +02:00
Jeroen van Rijn 0e9cd0fb6a Prepare for tlsf.free_all 2025-04-13 15:20:53 +02:00
Jeroen van Rijn 32c9f6d13a Remove bit_field -> bit_set warning.
The "This 'bit_field' might be better expressed as a 'bit_set' since all of the fields are booleans, of 1-bit in size, and the backing type is an integer" warning is imperfect. Disable it for now.
2025-04-12 14:01:18 +02:00
Jeroen van Rijn 0a97e01827 Add tests for type_elem_type on SIMD vectors 2025-04-11 23:31:02 +02:00
Jeroen van RijnandGitHub 29b03adab1 Merge pull request #5030 from Kelimion/type_elem_type
Allow intrinsics.type_elem_type(simd_vector) to return the element type.
2025-04-11 22:51:28 +02:00
Jeroen van Rijn 41d4ddbc5e Add reflect.length + reflect.capacity support for #simd[N]T 2025-04-11 22:44:02 +02:00
Jeroen van Rijn f4ce84dfb4 Add fix to reflect.typeid_elem 2025-04-11 22:24:19 +02:00
Jeroen van Rijn 04807309b7 Allow intrinsics.type_elem_type(simd_vector) to return the element type.
Make `type_elem_type(#simd[4]f32)` return `f32`, same as it would for `[4]f32`.
2025-04-11 21:49:48 +02:00
Jeroen van Rijn b27008e0f9 Simplify condition, op = Token_Sub was trivially true 2025-04-10 17:58:54 +02:00
Jeroen van Rijn 3a7691c714 Fixes #5026 2025-04-10 17:54:58 +02:00
Jeroen van RijnandGitHub 5912718002 Merge pull request #5023 from justgook/master
add quotes for absolute path
2025-04-09 14:39:31 +02:00
Jeroen van RijnandGitHub d401a089c8 Merge pull request #5022 from IllusionMan1212/fix-printing-long-strings
gb.h: fix buffer overflow when printing long strings.
2025-04-09 07:37:59 +02:00
Jeroen van RijnandGitHub dd826b759f Merge pull request #5021 from flysand7/fix-badge
Fix the CI badge URL
2025-04-08 22:55:58 +02:00
Jeroen van Rijn 329b15961a Don't run demo if building Odin fails.
`cl`'s return value was stomped by `mt`, so we ran the demo if `cl` failed, but `mt` succeeded.
This obscures `cl`'s output, so we're now checking both for errors.
2025-04-08 11:44:35 +02:00
Jeroen van Rijn eeb8b8dcc4 Fix #5020 2025-04-08 10:13:45 +02:00
Jeroen van RijnandGitHub 44bd2d3750 Merge pull request #5019 from Cararasu/master
vendor/glfw: fix SetMonitorCallback and MonitorProc type definition
2025-04-07 22:24:08 +02:00
Jeroen van RijnandGitHub d77b8aeaa1 Merge pull request #5018 from Barinzaya/fix-fmt-bitset-nonzero-enum
Fix printing of `bit_set[Enum]` when `min(Enum) != 0`
2025-04-07 22:01:19 +02:00
Jeroen van Rijn 716bd479a9 Disallow .Multiline in iterator. 2025-04-07 21:33:57 +02:00
Jeroen van Rijn 2b26c0b39e Remove now unused field. 2025-04-07 15:02:36 +02:00
Jeroen van Rijn a5e513567b Optimize regex match iterator.
Reuse virtual machine and capture groups between matches.
2025-04-07 14:58:41 +02:00
Jeroen van Rijn c13b68f103 Fix os2/process defer error. 2025-04-07 13:33:21 +02:00
Jeroen van Rijn 3287e1b0f0 Fix HXA defer warning 2025-04-07 13:19:00 +02:00
Jeroen van RijnandGitHub bee158d53a Merge pull request #5010 from Feoramund/fix-netbsd-arm64-syscall
Fix `syscall_bsd` on NetBSD ARM64
2025-04-07 11:30:13 +02:00
Jeroen van Rijn 9a2b6c01aa Return loop index in regex iterator. 2025-04-06 21:45:37 +02:00
Jeroen van Rijn 66077add33 {.Glboal} implicit in regex allocator. 2025-04-06 21:13:02 +02:00
Jeroen van RijnandGitHub 07a79254e0 Merge pull request #5008 from Kelimion/regex-iterator
Add iterator for `core:text/regex`.
2025-04-06 14:32:50 +02:00
Jeroen van Rijn 918d57fe01 Keep -vet happy. 2025-04-06 14:24:17 +02:00
Jeroen van Rijn cdc56dc691 Add iterator for core:text/regex.
Usage:
```odin
haystack := `xxfoobarxfoobarxx`
pattern  := `f(o)ob(ar)`

it := regex.create_iterator(haystack, pattern, {.Global}) or_return
defer regex.destroy(it)

for capture in regex.match(&it) {
	fmt.println(capture)
}
```
2025-04-06 14:19:14 +02:00
Jeroen van Rijn dbefee8905 Fix broken asan on Windows. 2025-04-05 22:01:16 +02:00
Jeroen van Rijn a6977ac733 Remove stray import. 2025-04-05 19:25:39 +02:00
Jeroen van Rijn 4b203d0c78 Fix segfault in core:sys/info on WSL2 2025-04-05 19:23:58 +02:00