Commit Graph

6628 Commits

Author SHA1 Message Date
Lucas Perlind
5292a7f4f3 Fix posix 2025-05-08 17:41:03 +10:00
Lucas Perlind
1bea59ee68 Fix linux 2025-05-08 17:41:03 +10:00
Lucas Perlind
190960e103 fix -vet 2025-05-08 17:41:03 +10:00
Lucas Perlind
b9db1dd3e0 os2: Resolve temp allocator collisions 2025-05-08 17:41:01 +10:00
gingerBill
90a30a145a Merge pull request #5122 from Lperlind/asan-allocators
Add asan support for various allocators and stack unpoisoning
2025-05-07 10:21:16 +01:00
Laytan
7c1a9f1e7a Merge pull request #5127 from laytan/fix-process-windows-handles-handling
Fix process windows handles handling
2025-05-06 22:31:54 +02:00
laytan
9b218a2922 don't need to hang on to the null handle 2025-05-06 19:42:52 +02:00
Laytan
bf5206968a close null_handle 2025-05-06 20:57:26 +02:00
Laytan
2bce446d08 ifs wrong way around 2025-05-06 20:47:51 +02:00
Laytan
814a500e83 Windows was defaulting to the std handles of the current process, which is wrong 2025-05-06 20:43:02 +02:00
gingerBill
0cf5b5984d Merge pull request #5108 from Barinzaya/core-simd-indices-redadd-redmul
Alternate `reduce_add`/`reduce_mul` intrinsics
2025-05-06 15:46:49 +01:00
gingerBill
e074518983 Merge pull request #5124 from Barinzaya/core-simd-bmi-intrinsics
BMI/BMI2 Intrinsics
2025-05-06 15:29:34 +01:00
Brian
27edbc5a76 Fix: Correct value cloning in os2._set_env for POSIX
The _set_env procedure in core/os/os2/env_posix.odin was
incorrectly cloning the 'key' argument for 'cval' instead of
the 'value' argument. This resulted in set_env effectively
setting the environment variable's value to its own key.

This commit corrects the typo to use the 'value' argument.
2025-05-06 17:45:06 +08:00
Barinzaya
41bf1ab6dd Added BMI and BMI2 intrinsics.
The BMI ones mostly aren't particularly interesting--they're mostly
trivially representable in-language--but PDEP and PEXT from BMI2 could
be.
2025-05-06 01:44:10 -04:00
Lucas Perlind
83bc2d3c4a Add asan support for various allocators 2025-05-06 14:55:50 +10:00
Jeroen van Rijn
8032db3484 Fix CreateDibSection binding 2025-05-05 23:23:39 +02:00
Barinzaya
dd5b7852ce Added alternate reduce-add/reduce-mul intrinsics.
The new reduce_add/reduce_mul procs perform the corresponding arithmetic
reduction in different orders than sequential order. These alternative
orders can often offer better SIMD hardware utilization.

Two different orders are added: pair-wise (operating on pairs of
adjacent elements) or bisection-wise (operating element-wise on the
first and last N/2 elements of the vector).
2025-05-05 16:38:45 -04:00
gingerBill
c4719e75fd Add simd.indices and docs 2025-05-05 11:43:19 +01:00
gingerBill
bc2a4dfe9d Merge pull request #5110 from omark96/feat/get_window_thread_process_id
win/sys: Add GetWindowThreadProcessId
2025-05-05 10:17:29 +01:00
Laytan
93f80f60fb Merge pull request #5112 from blob1807/master
`core:bufio`: Fix typo from `b.w-b.w` to `b.w-b.r`
2025-05-05 03:00:46 +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 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
blob1807
39752faba4 Fix typo from b.w-b.w -> b.w-b.r 2025-05-04 15:48:26 +10: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
omark96
1b8a65c327 win/sys: Add GetWindowThreadProcessId 2025-05-03 23:44:55 +02:00
Rohan Jadav
f50698b901 updated file_windows.odin to follow coding conventions 2025-05-01 00:56:31 +05:30
Jamie Dennis
ff0eac2a71 os2: Use win32_wstring_to_utf8 over win32_utf16_to_utf8 when converting FIND_DATAW to File_Info 2025-04-30 21:38:17 +12:00
Vincent Billet
d24bac8a36 Adding windows keyboard scan codes 2025-04-29 18:00:41 +02:00
Barinzaya
3f5e09a0df Fixed an overflow when decoding a large CBOR slice.
The initial allocation for the slice is limited to prevent untrusted
data from forcing a huge allocation, but then the dynamic array was
created with a capacity of the unlimited length, rather than the actual
capacity of the allocation. This was causing a buffer overrun.
2025-04-29 08:19:43 -04: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
Ely Alon
13566306d2 Fix typo in private function 2025-04-28 22:03:20 +03:00
Rohan Jadav
80a6f8928a fix: Pipe size on windows. 2025-04-27 01:58:37 +05:30
gingerBill
f3cc734b39 Add copy_directory 2025-04-25 09:01:53 +01:00
gingerBill
9f30380712 Merge pull request #5072 from Lperlind/asan
Add more asan support to the odin runtime and begin sanitizing allocators
2025-04-25 08:24:18 +01:00
Barinzaya
6400693197 Added tick_add proc to core:time. 2025-04-24 09:20:31 -04:00
Lucas Perlind
5c117bde6d Add base:sanitizer package 2025-04-24 20:28:32 +10:00
Lucas Perlind
ab0b26e876 Add more asan support to the odin runtime and begin sanitizing
allocators

This adds various bindings to the asan runtime which can be used
to poison/unpoison memory handed out by various allocators. This
means we can catch use after free memory bugs when using operations
such as free_all during runtime.

Asan poisoning are added for the follow allocators in mem:
Arena (including temporary arenas)
Scratch
Stack
Small_Stack

Additionally a bug in the stack allocator was fixed to disallow freeing
in the middle of the stack (caught by the asan!).

I plan on adding support for all the allocators in core. This is just
a good starting point and were some of the easiest ones to implement
asan for.
2025-04-24 15:17:51 +10:00
mtarik34b
c7f9d2b1b7 Correctly capitalize 'E' for the %E format specifier (#5065) 2025-04-22 02:35:02 +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 Rijn
062a3c2fae Fix parsing of CDATA tags (#5059)
Fixes #5054
2025-04-19 20:25:44 +02:00
Jeroen van Rijn
bc86b50392 Replace default_tcp_options with constant (#5056)
Replace `default_tcp_options` with constant
2025-04-19 14:32:59 +02:00
gingerBill
4374685007 Merge pull request #5042 from fusion32/fix-once-do-without-data-contextless
make once_do_without_data_contextless actually contextless
2025-04-18 11:47:10 +01:00
Laytan
2dedb199b8 Merge pull request #5052 from harold-b/hb/fix-ns-dictionary-selectors
Fix 2 selectors in NSDictionary
2025-04-17 21:28:10 +02:00
Harold Brenes
040d8b1d48 Fix 2 selectors in NSDictionary 2025-04-17 15:22:10 -04: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 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