Commit graph

7090 commits

Author SHA1 Message Date
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
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
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
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
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
mlugg
35d82d31be Add @inComptime builtin
Resolves: #868
2023-04-23 13:16:42 -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
Hubert Jasudowicz
253eb72c14 std.os.linux: Add new CAP constants 2023-04-23 20:58:30 +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
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
David CARLIER
6248ac535b os: getrandom wrapper favoring it for macOs/iOs only 2023-04-22 21:01:12 +01:00
David CARLIER
c579a23c5d std: add CCRandomGenerateBytes macOs native api. 2023-04-22 21:01:12 +01:00
Andrew Kelley
21aa55d34e
Merge pull request #15356 from jacobly0/cbe-std-tests
cbe: enable CI for std tests
2023-04-22 11:04:36 -07:00
David CARLIER
29bc6fc242 process: totalSystemMemory freebsd portage 2023-04-22 14:10:30 +03:00
Borja Clemente
bd801dc489
std: GPA deinit return an enum instead of a bool 2023-04-22 14:09:44 +03:00
David CARLIER
3f259d3550 std: adding netbsd's pthread to cpu affinity api 2023-04-22 13:59:00 +03:00
Bogdan Romanyuk
b22155d352
Add doc comments for ComptimeStringMap
Some parts of stdlib are still undocumented yet.
2023-04-22 13:55:30 +03:00
David CARLIER
dbdafb6cc5 os: expand sched_getaffinity wrapper and update freebsd's cpuset api flags. 2023-04-22 13:54:57 +03:00
-k
0282c2a924 doc: fix minor grammar issues 2023-04-22 13:09:15 +03:00
Jacob Young
3f1c51ca90 std: remove names from incorrectly named tests
Tests that only reference decls for the purpose of analyzing more tests
should be unnamed, otherwise trying to filter for just a referenced test
can become impossible depending on the names.
2023-04-21 23:08:48 -04:00
Manlio Perillo
4374ce51b0 std.Build.RunStep: fix captureStdOut function return type
The return type of the captureStdOut function is incorrect.
Replace *std.Build.GeneratedFile with std.Build.FileSource.
2023-04-21 15:24:23 -07:00
Jacob Young
7ca9b835a1 std: disable failing test
Tracked by #15381
2023-04-21 16:36:31 -04:00
Jacob Young
a1ed4bd796 cbe: fix remaining aarch64 issues 2023-04-21 16:36:31 -04:00
Jacob Young
bf6fd9ae3f cbe: enable CI for std tests 2023-04-21 16:36:10 -04:00
Frank Denis
391663e497
AEGIS MAC: add support for 128-bit tags (#15379)
When used as a MAC, 256-bit tags are recommended.
But in interactive protocols, 128 bits may be acceptable.
2023-04-21 19:52:33 +00:00
David CARLIER
83970b6d91 std: adding freebsd's elf_aux_info api 2023-04-21 11:42:49 -07:00
Ryo Ota
afebef2465 create std.http.Server.Response.deinit to handle keepalive connections 2023-04-21 10:17:16 +09:00
Ryo Ota
06763c4c8c move the HTTP test to lib/std/http/test.zig 2023-04-21 09:51:23 +09:00
Andrew Kelley
a86759984c
Merge pull request #15316 from xEgoist/fileDisposition
windows: use NtSetInformationFile in DeleteFile.
2023-04-20 16:30:27 -07:00
Andrew Kelley
a1f7c8d860
Merge pull request #14696 from r00ster91/thread
std.Thread: use dead code
2023-04-20 16:03:12 -07:00
Stevie Hryciw
e8fdb249b6 std.math.big.int: Initialize limbs in addWrap
When a big.Int.Mutable had more than two limbs, it was possible for
this function to change the `len` field without zeroing limbs in the
active range. These uninitialized limbs would then be used in
`truncate()` and could cause invalid results.

Closes #13571
2023-04-20 16:00:37 -07:00
zooster
7d90410b96
std.math: add lerp (#13002) 2023-04-20 18:52:44 -04:00
zooster
b7c00999be std.fs: add linking docs to makeDir*
Docs that link back to the other similar functions.
2023-04-20 15:47:39 -07:00