23744 Commits

Author SHA1 Message Date
mlugg
3df2f356eb
Sema: avoid emitting sequential dbg_stmt instructions
Often, a `dbg_stmt` ends up being associated with no real code because
whatever it referred to was eliminated by semantic analysis. In these
cases, Sema can replace the last `dbg_stmt` with the new one to avoid
redundant AIR instructions which at best are nops and at worst cause
backends to emit useless info (e.g. CBE does this).
2023-04-26 01:46:09 +01:00
mlugg
2e23ddbe7b
CBE: minor optimizations to output source 2023-04-26 01:46:09 +01:00
kcbanner
295b8ca467 sema: add error for coercing a slice to an anyopaque pointer 2023-04-26 00:53:09 +03:00
Janne Hellsten
61236c2aa1
std: @Vector support for std.json.parse 2023-04-26 00:52:17 +03:00
Andrew Kelley
5b9e528bc5 CI: give aarch64-linux a maxrss parameter
to avoid getting OOM killed. We need to have a high number of GitHub
Actions runners simultaneously active, otherwise the hardware ends up
underutilized. But with zig build running in parallel now, this
sometimes results in memory usage spikes that have been causing the
runner to get killed.

This number is the total physical memory (251G) divided by the number of
runners we have active (11).

See related commit 2d41dac57d3afdd5fe3d03be08ff0a24833f61dd which did
the same but for our x86_64-linux machines.
2023-04-25 12:46:39 -07:00
Loris Cro
e0ee9d38cf
Merge pull request #15414 from der-teufel-programming/autodoc-pkg-mod
autodoc: Change package to module to better reflect the new names
2023-04-25 20:24:40 +02:00
Loris Cro
015ea6fd6c
Merge branch 'master' into autodoc-pkg-mod 2023-04-25 20:03:53 +02:00
David CARLIER
8d88dcdc61 std.c: adding mincore for freebsd 2023-04-25 10:43:54 -07:00
xEgoist
f780a6b024 std: further windows resource fix
addition to #15450
createFileW does not account for failure on `LockFile`. This can result
in a file handle not being closed on failure which can be seen on test
such as `fs.test.'open file with exclusive nonblocking lock twice'`.
2023-04-25 10:37:49 -07:00
Jacob Young
d8bdfd8192 std: fix windows resource leaks 2023-04-24 16:50:44 -07:00
Andrew Kelley
a2fe81a639
Merge pull request #15421 from Vexu/fixes
Runtime safety improvements
2023-04-24 16:23:03 -07:00
Ryo Ota
bba90b8863 fix HTTP server to handle a chunked transfer coding request 2023-04-24 15:36:35 -07:00
Andrew Kelley
1d1255b433
Merge pull request #15416 from squeek502/http-response-headers-undefined
std.http: Always initialize `response.headers` in Client.request
2023-04-24 15:15:17 -07:00
Andrew Kelley
ef0a02081d
Merge pull request #15290 from mlugg/feat/builtin-in-comptime
Add `@inComptime` builtin
2023-04-24 12:54:12 -07:00
David CARLIER
7439eb5e99 std.os: selfExePath implementation for haiku 2023-04-24 22:41:44 +03:00
Andrew Kelley
dc94729643 CI: disable compiling std lib C backend test with clang
Unfortunately this requires about 8G of RAM for clang to compile
and our Windows CI runners do not have this much.
2023-04-24 11:58:45 -07:00
Andrew Kelley
39644fb277 Revert "tests: add a maxrss for compiling std lib C backend .c file"
This reverts commit c75e11bf6aa67f2ca62b9b6677d134592777bfec.

Caused this problem on some machines:
"this step declares an upper bound of 9126805504 bytes of memory,
exceeding the available 7515721728 bytes of memory".

Instead the next commit will disable std lib tests with the C backend on
Windows.
2023-04-24 11:51:46 -07:00
David Carlier
1084590ec4 std.c: add find_path for haiku 2023-04-24 12:32:46 +03:00
Jon
529064856a
std.net.StreamServer.Options: add reuse_port 2023-04-24 12:23:22 +03:00
Ian Johnson
2be347a2c8 Sema: allow method calls on optional pointers 2023-04-24 09:35:54 +03:00
Andrew Kelley
c75e11bf6a tests: add a maxrss for compiling std lib C backend .c file
I observed clang taking 8G to compile the output from the std lib tests
using the C backend. This commit should make the Windows CI stop failing
due to OOM.
2023-04-23 22:24:13 -07:00
David CARLIER
5c70d7bc72 std.process: further totalSystemMemory portage 2023-04-24 05:49:48 +03:00
David Carlier
c66151a226 std.os: sysctl* wrappers, better warning at compile time 2023-04-24 03:59:35 +03:00
Andrew Kelley
2dbcc03fb8
Merge pull request #15405 from Luukdegram/wasm
wasm: implement more runtime safety checks
2023-04-23 15:39:36 -07:00
Ryan Liptak
0488c3cb52 std.http: Always initialize response.headers in Client.request
Before this change, if a request errored before getting its `response.headers` initialized, then it would attempt to `deinit` `response.headers` which would still be `undefined`. Since all locations that set `response.headers` use the same code, it can just be done upfront in `request` instead.

Closes #15380
2023-04-23 15:33:23 -07:00
Ryan Liptak
1acb3162b7 http.Headers: Add clearAndFree and clearRetainingCapacity 2023-04-23 15:33:05 -07:00
Andrew Kelley
3878586821 update zig1.wasm 2023-04-23 13:33:20 -07:00
mlugg
35d82d31be Add @inComptime builtin
Resolves: #868
2023-04-23 13:16:42 -07:00
kcbanner
42ee364e7b translate-c: support brace-enclosed string initializers (c++20 9.4.2.1) 2023-04-23 21:45:08 +03: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
Manlio Perillo
658b4db223
langref: improve for loop documentation
- Add an example of iterating over consecutive integers using the
    range syntax
  - Add an example of iterating over multiple objects
  - Update the "nested break" and "nested continue" tests to use the
    range syntax, instead of a temporary array
2023-04-23 21:00:10 +03:00
Hubert Jasudowicz
253eb72c14 std.os.linux: Add new CAP constants 2023-04-23 20:58:30 +03:00
Bogdan Romanyuk
316812786c langref: add documentation for noinline keyword 2023-04-23 20:56:06 +03:00
Travis Staloch
40029d6875 std.tar: make sub dirs + trim spaces
closes #15222. these changes allow the .tgz from this issue to
decompress and the test code to succeed.
2023-04-23 20:39:28 +03:00
Nicolas Sterchele
284c7b22a8 process: add args definition comment
To improve understandability of its purpose.
2023-04-23 20:26:10 +03:00
xEgoist
ce3fe72d9a fs.Dir.deleteTree: Fix DirNotEmpty condition
`deleteTree` needs to retry once the directory is reported to be not
empty. Otherwise, the retry condition is never reached.
2023-04-23 19:51:51 +03:00
David CARLIER
23c4f55a61 std: adding sigevent to supported platforms. 2023-04-23 19:46:43 +03:00
David CARLIER
9ef615104a std: adding FreeBSD's sched wrappers 2023-04-23 19:46:30 +03:00
David Carlier
9691cded95 std: mcontext layout for x86 and fixing few x86_64 fields types for
FreeBSD
2023-04-23 19:46:18 +03:00
David CARLIER
1d322fe510 std: add accept_filter struct to make use of SO_ACCEPTFILTER socket option 2023-04-23 19:45:59 +03:00
David CARLIER
7b0e015eb4 std: add a subset of the macOs's libproc api. 2023-04-23 19:45:46 +03:00
David CARLIER
9140249d29 std: enriching malloc api on freebsd. 2023-04-23 19:45:34 +03:00
Veikka Tuominen
f1e43d1f4f Sema: emit cast to null panics for function pointers
Closes #14676
2023-04-23 19:09:14 +03:00
Andrew Kelley
1884be4ecd
Merge pull request #15372 from nwtgck/fix-http-client 2023-04-23 06:29:46 -07:00
Jakub Konka
b95cdf0aeb elf: add helpers for extracting type and bind from symbol def 2023-04-23 13:50:24 +02:00
Jakub Konka
c3ce04b9e5 elf: add missing doc comments to some definitions 2023-04-23 13:24:59 +02:00
Veikka Tuominen
c3b30a0fd0 enable passing test
Closes #12360
2023-04-23 12:29:58 +03:00
Veikka Tuominen
f3d18d5413 AstGen: fix debug info for some builtins
Closes #15163
2023-04-23 12:28:50 +03:00
Krzysztof Wolicki
a260fa8bf2 autodoc: Change package to module to better reflect the new names 2023-04-23 01:02:09 +02:00
Luuk de Gram
6c1ab376dd
wasm: store __zig_lt_errors_len in linear data
Rather than using a function call to verify if an error fits within
the global error set's length, we now store the error set' size in
the .rodata segment of the linear memory and load that value onto
the stack to check with the integer value.
2023-04-22 21:57:38 +02:00