Commit Graph

15268 Commits

Author SHA1 Message Date
Samuel Elgozi 0f12618642 fix incorrect use of Bool 2025-01-18 21:08:54 +02: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
David Rubin 5951c25f71 fix inverted error messages 2025-01-18 02:04:35 -08:00
Laytan 47030501ab Merge pull request #4585 from wrapperup/miniaudio-bitsets
`vendor:miniaudio`: Use bit sets for flags
2025-01-17 18:42:46 +01:00
Laytan 8e9726866a remove other redundant constant 2025-01-17 18:31:39 +01:00
gingerBill 328d70e244 Merge pull request #4696 from alektron/ArenaBug
Non-zeroed memory after Arena free
2025-01-17 14:20:28 +00:00
gingerBill ed18f539c7 Merge pull request #4698 from 4teapo/mem-additions
Add SoA make/delete to core:mem
2025-01-17 14:20:02 +00:00
gingerBill b9bf5b1496 Merge pull request #4703 from flysand7/4685-range-stack-overflow
Do not warn about stack overflow in range loops 'by reference'
2025-01-17 13:23:15 +00:00
gingerBill fcd3cf7fa8 Merge pull request #4704 from flysand7/4614-thread-locals
Error if `-no-crt` is used without `-no-thread-locals`
2025-01-17 13:22:47 +00:00
Samuel Elgozi 3fb766f98d updated to meet formatting style 2025-01-17 13:43:34 +02:00
Samuel Elgozi 19d6c01f0f Added Foundation bindings 2025-01-17 10:42:32 +02:00
flysand7 3f20b63243 Error if -no-thread-local is used in presence of -no-crt on Unix 2025-01-17 02:51:22 +03:00
flysand7 4f0206ce08 Added compile-time checks for thread locals with -no-crt
Now using any thread-local variables with -no-crt enabled
will cause a compiler error, unless -no-thread-local is
given.

Also fixed a minor typo in a comment.
2025-01-17 01:12:23 +03:00
flysand7 87b590c99b Do not warn about stack overflow in range loops 'by reference' 2025-01-16 22:11:30 +03:00
Laytan 16eca1ded1 Merge pull request #4702 from flysand7/4632-futex-windows
[sync]: Fix typos in comments and remove my note.
2025-01-16 18:05:51 +01:00
flysand7 9da144157e [sync]: Fix typos in comments and remove my note. 2025-01-16 19:33:09 +03:00
James Duran 13640620ce Fix captures not begin zeroed when haystack length is 0 2025-01-15 15:56:40 -08:00
Laytan Laats aa3f0b86c1 compiler: fix align error check 2025-01-15 20:18:50 +01:00
teapo 4895065afb Add SoA make/delete to core:mem 2025-01-15 20:16:57 +01:00
James Duran a7971f9f6f Allow captures in gfind and gmatch to be used in-loop 2025-01-15 11:02:46 -08:00
alektron 32d747cf8b Merge branch 'master' into ArenaBug 2025-01-15 18:00:29 +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
Laytan e55b652916 Merge pull request #4678 from clindholm/glfw_get_monitor_workarea
vendor/glfw: add GetMonitorWorkarea binding
2025-01-15 10:37:42 +01:00
Laytan 0cb04f5153 Merge pull request #4691 from harold-b/fix-unused-define-crash-when-ignore-warnins
Fixes crash when unused defines are used in conjunction with `-ignore-warnings`
2025-01-15 10:37:15 +01:00
Harold Brenes 794e812932 Fixes crash when unused defines are used in conjunction with -ignore-warnings. 2025-01-15 02:04:49 -05:00
Laytan 432c49e214 Merge pull request #4689 from karl-zylinski/d3d12-tabs-fix
d3d12 bindings -vet-tabs fix
2025-01-14 06:11:57 +01:00
Karl Zylinski 1613728a64 d3d12 bindings -vet-tabs fix 2025-01-13 23:37:36 +01:00
gingerBill 440acc42a9 Merge pull request #4686 from laytan/ensuref-and-other-fixes
add ensure and ensuref to fmt and log, fix some inconsistencies
2025-01-13 20:38:36 +00:00
Laytan Laats 9d4fa39daa add ensure and ensuref to fmt and log, fix some inconsistencies 2025-01-13 20:33:49 +01:00
gingerBill 48a7ed01f8 Merge pull request #4675 from jasonKercher/os2-dir-linux
Implement os2 dir linux
2025-01-13 11:04:55 +00:00
Jeroen van Rijn 600e0ebed0 Fix stray space vs. tab 2025-01-12 12:13:29 +01:00
Christiano Haesbaert 5699c533c6 Add net.dial_tcp_from_host{_or_endpoint} and unify them
The main motivation for this is to have sinergy with flags parsing, currently
flags for a sockaddr returns a net.Host_Or_Endpoint, but we can't just dial
from it since there isn't a variant.

Consider the following:

```
Options :: struct {
	target: net.Host_Or_Endpoint `args:"pos=0,required" usage:"host:port"`,
}

before :: proc() -> (sock: net.TCP_Socket, err: net.Network_Error) {
	opt: Options

	flags.parse_or_exit(&opt, os.args)
	switch t in opt.target {
	case net.Host:
		sock, err = net.dial_tcp(t.hostname, t.port)
	case net.Endpoint:
		sock, err = net.dial_tcp(t)
	}
	return
}

after :: proc() -> (sock: net.TCP_Socket, err: net.Network_Error) {
	opt: Options

	flags.parse_or_exit(&opt, os.args)
	sock, err = net.dial_tcp(opt.target)
	return
}

```

For completion, add dial_tcp_from_host() and define the upper functions in terms
of the newly added ones, cuts one repeated block, now:

from_hostname_and_port_string is parse + from_host_or_endpoint
from_hostname_with_port_override is parse + override + from_host_or_endpoint
from_host is to_endpoint + from_endpoint
from_host_or_endpoint is from_endpoint or from_host
2025-01-12 02:41:35 +01:00
Christiano Haesbaert c51df72f1a Make sure we don't leak os.args. Fixes #1633.
os.args is never freed, while this is an insignificant leak, it is a bit
annoying as it makes valgrind complain:

==234270== Memcheck, a memory error detector
==234270== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==234270== Using Valgrind-3.24.0 and LibVEX; rerun with -h for copyright info
==234270== Command: ./wc /tmp/mulumulu
==234270==
       1       8      58 /tmp/mulumulu
==234270==
==234270== HEAP SUMMARY:
==234270==     in use at exit: 47 bytes in 1 blocks
==234270==   total heap usage: 5 allocs, 4 frees, 4,195,875 bytes allocated
==234270==
==234270== 47 bytes in 1 blocks are possibly lost in loss record 1 of 1
==234270==    at 0x484BC13: calloc (vg_replace_malloc.c:1675)
==234270==    by 0x402E49: runtime._heap_alloc-769 (in /d/learn-odin/wc/wc)
==234270==    by 0x40A8D7: runtime.heap_alloc (in /d/learn-odin/wc/wc)
==234270==    by 0x436E9D: runtime.heap_allocator_proc.aligned_alloc-0 (in /d/learn-odin/wc/wc)
==234270==    by 0x4022DC: runtime.heap_allocator_proc (in /d/learn-odin/wc/wc)
==234270==    by 0x4165E0: runtime.make_aligned-22560 (in /d/learn-odin/wc/wc)
==234270==    by 0x41F6D0: runtime.make_slice-22340 (in /d/learn-odin/wc/wc)
==234270==    by 0x40156B: os._alloc_command_line_arguments-4679 (in /d/learn-odin/wc/wc)
==234270==    by 0x4011AF: __$startup_runtime (in /d/learn-odin/wc/wc)
==234270==    by 0x406F17: main (in /d/learn-odin/wc/wc)
==234270==
==234270== LEAK SUMMARY:
==234270==    definitely lost: 0 bytes in 0 blocks
==234270==    indirectly lost: 0 bytes in 0 blocks
==234270==      possibly lost: 47 bytes in 1 blocks
==234270==    still reachable: 0 bytes in 0 blocks
==234270==         suppressed: 0 bytes in 0 blocks
==234270==
==234270== For lists of detected and suppressed errors, rerun with: -s
==234270== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

With the fix the leak is gone, tested on linux only.

While here, also make _alloc_command_line_arguments() private.
2025-01-11 21:55:09 +01:00
clindholm 93e8f5024e vendor/glfw: add GetMonitorWorkarea binding 2025-01-11 15:03:12 +01:00
jason c11dccf210 make -vet happy 2025-01-10 20:59:48 -05:00
jason fa7ef28acf Implement _read_directory_iterator in os2.
Also, fix minor bug in linux.dirent_name.
2025-01-10 20:54:09 -05:00
Laytan cd93e2f6f8 Merge pull request #4672 from shizeeg/master
add os.exists() to FreeBSD
2025-01-11 01:03:36 +01:00
Laytan Laats 896319d0d5 ci: test issues on windows 2025-01-11 01:00:15 +01:00
Laytan Laats e3c0cc9dfc time: add haiku 2025-01-11 00:18:36 +01:00
Laytan e4ae832775 Merge pull request #4603 from avanspector/master
Haiku: fix build and add initial `core:sys/posix` support
2025-01-11 00:06:29 +01:00
avanspector cc50fab8e3 Merge branch 'odin-lang:master' into master 2025-01-10 22:47:44 +01:00
avanspector ab7b5a5445 Haiku: change uintptr to uint where appropriate 2025-01-10 15:14:03 +01:00
gingerBill 328d893cb5 #unroll(N) for 2025-01-10 12:22:18 +00:00
gingerBill 4a2b13f1c2 Fix foreign import names 2025-01-10 10:18:30 +00:00
gingerBill b377ac182c Keep -vet happy 2025-01-10 10:15:15 +00:00
gingerBill fd058dff46 Merge branch 'master' of https://github.com/odin-lang/Odin 2025-01-10 10:12:42 +00:00
gingerBill 3d4a20918f Simplify stb foreign imports 2025-01-10 10:12:36 +00:00
gingerBill 5a259ed0ee Merge pull request #4669 from denovodavid/pr-d3d12-shader-component-mapping
vendor:directx/d3d12: add shader component mapping constants and macro-procedures
2025-01-10 09:44:17 +00:00
avanspector c686728184 Update dir_unix.odin 2025-01-10 07:15:44 +01:00
avanspector 0a985f5d02 Haiku: small fixes across core 2025-01-10 07:07:40 +01:00