Commit graph

61 commits

Author SHA1 Message Date
Andrew Kelley
6261c13731 update codebase to use @memset and @memcpy 2023-04-28 13:24:43 -07:00
zooster
bc8e1e1de4
Improvements to docs and text
* docs(std.math): elaborate on difference between absCast and absInt

* docs(std.rand.Random.weightedIndex): elaborate on likelihood

I think this makes it easier to understand.

* langref: add small reminder

* docs(std.fs.path.extension): brevity

* docs(std.bit_set.StaticBitSet): mention the specific types

* std.debug.TTY: explain what purpose this struct serves

This should also make it clearer that this struct is not supposed to provide unrelated terminal manipulation functionality such as setting the cursor position or something because terminals are complicated and we should keep this struct simple and focused on debugging.

* langref(package listing): brevity

* langref: explain what exactly `threadlocal` causes to happen

* std.array_list: link between swapRemove and orderedRemove

Maybe this can serve as a TLDR and make it easier to decide.

* PrefetchOptions.locality: clarify docs that this is a range

This confused me previously and I thought I can only use either 0 or 3.

* fix typos and more

* std.builtin.CallingConvention: document some CCs

* langref: explain possibly cryptic names

I think it helps knowing what exactly these acronyms (@clz and @ctz) and
abbreviations (@popCount) mean.

* variadic function error: add missing preposition

* std.fmt.format docs: nicely hyphenate

* help menu: say what to optimize for

I think this is slightly more specific than just calling it
"optimizations". These are speed optimizations. I used the word
"performance" here.
2023-04-23 21:06:21 +03:00
Andrew Kelley
34286530b7 Cache: fix multi-process race condition on macOS
This fixes `.INVAL => unreachable` being triggered by the cache system
on macOS when multiple processes race to create the same compilation.
The problem is that when two processes race to create a file, it
sometimes returns ENOENT even though that error code is nonsensical for
this situation.

Commit 2b0929929d purportedly solved this,
but it did not open the file with write permissions, leading to the
EINVAL panic later on. This commit remedies the situation by introducing
a loop and simply retrying when the ENOENT occurs.
2023-04-18 17:53:47 -07:00
mlugg
ccf670c2b0 Zir: implement explicit block_comptime instruction
Resolves: #7056
2023-04-12 12:06:19 -04:00
Andrew Kelley
717e2c8718 std.Build.Cache: make unit tests not depend on cwd
This makes them more resilient to being run multiple times by multiple
different processes at the same time.
2023-03-15 10:48:15 -07:00
Andrew Kelley
11de55d0dd std.Build.Cache: handle ENOENT on createFile race
Companion commit to 628fec41593a2d2eca8b504e4fe90de9823aeded
2023-03-15 10:48:15 -07:00
Andrew Kelley
2b0929929d std.Build.Cache: handle ENOENT on createFile race
There are no dir components, so you would think that this was
unreachable, however we have observed on macOS two processes racing
to do openat() with O_CREAT manifest in ENOENT.
2023-03-15 10:48:15 -07:00
Andrew Kelley
e0561ad79b std.Build.Cache.Directory: add a format() method 2023-03-15 10:48:13 -07:00
Ali Chraghi
75ff34db9e std.Build.Cache: remove 'test-filetimestamp.tmp' once timestamp returned 2023-03-03 13:50:44 -05:00
Andrew Kelley
0666322614 std.Build.Cache: remove debug log statements
Now that this API is used by the build system, these debug logs are
problematic because build scripts run in debug mode, making these logs
noisy output.
2023-02-13 06:42:25 -07:00
Andrew Kelley
9cb52ca6ce move the cache system from compiler to std lib 2023-02-13 06:42:25 -07:00
Renamed from src/Cache.zig (Browse further)