8 Commits

Author SHA1 Message Date
Mitchell Hashimoto
b7bf59d772 update zig 2024-03-22 11:15:26 -07:00
Jonathan Marler
e1996ad1e5 os: remove UB, tmpDir is returning stack memory on Windows
On Windows, the tmpDir function is currently using a buffer on the stack
to convert the WTF16-encoded environment variable value "TMP" to utf8
and then returns it as a slice...but that stack buffer is no longer valid
when the function returns.  This was causing the "image load...temporary
file" test to fail on Windows.

I've updated the function to take an allocator but it only uses
the allocator on Windows.  No allocation is needed on other platforms
because they return environment variables that are already utf8 (ascii)
encoded, and the OS pre-allocates all environment variables in the process.
To keep the conditional that determines when allocation is required, I
added the `freeTmpDir` function.
2024-02-10 21:09:05 -07:00
Mitchell Hashimoto
86bd972d22 macos: do not change nofile rlimit max
Fixes #1146

I can't remember why we did this before. The comment in question makes
sense if we were trying to set cur to infinity but doesn't make sense to
me why we'd change max. Removing this doesn't seem to cause any issues
so lets give it a shot.
2023-12-22 08:58:31 -08:00
Will Pragnell
8f2ab46e1e windows: use cross platform consts where available 2023-09-15 16:01:33 -07:00
Will Pragnell
57894786d4 windows: implement tmpDir 2023-09-14 20:48:09 -07:00
Mitchell Hashimoto
26e17de777 add os.tmpDir to get the recommended temp dir base path 2023-07-09 11:58:04 -07:00
Mitchell Hashimoto
8a83a1e4a9 fix min usage in src/os 2023-06-25 11:17:51 -07:00
Mitchell Hashimoto
f39484541f set system locale on startup, read Mac locale from OS preferences 2022-11-14 09:59:22 -08:00