aboutsummaryrefslogtreecommitdiff
path: root/lib/std
AgeCommit message (Collapse)Author
2025-08-26std.compress.xz.Decompress: some tests passingAndrew Kelley
2025-08-26std.compress.xz: skeleton in placeAndrew Kelley
missing these things: - implementation of finish() - detect packed bytes read for check and block padding - implementation of discard() - implementation of block stream checksum
2025-08-26std.compress.lzma2: tests passingAndrew Kelley
2025-08-26std.compress.lzma: delete dead parameterAndrew Kelley
update is always passed as true
2025-08-26std.compress.lzma: tests passingAndrew Kelley
2025-08-26std.compress.lzma: update for new I/O APIAndrew Kelley
2025-08-26std.compress.xz: flatten namespacesAndrew Kelley
2025-08-26std.compress: flatten lzma and lzma2 namespacesAndrew Kelley
2025-08-26std.Build.WebServer: fix racemlugg
Just a typo: I wasn't actually using the duped message, so the message I sent could be freed in this interval.
2025-08-26std.Build.Step.Compile: fix race condition in args file creationIan Johnson
Fixes #23993 Previously, if multiple build processes tried to create the same args file, there was a race condition with the use of the non-atomic `writeFile` function which could cause a spawned compiler to read an empty or incomplete args file. This commit avoids the race condition by first writing to a temporary file with a random path and renaming it to the desired path.
2025-08-26Compilation: use std.DequeIsaac Freund
And delete DeprecatedLinearFifo from the source tree.
2025-08-26`std.ArrayList`: add `insertSliceAssumeCapacity()` and ↵Rue
`insertSliceBounded()` (#24978) closes #24929
2025-08-26std.Target: add vita osMaciej 'vesim' Kuliński
Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>
2025-08-26std.Build.Step.TranslateC: forward --cache-dir and --global-cache-dir flagsAdamGoertz
2025-08-25add macOS handling for totalSystemMemory (#24903)Sardorbek Imomaliev
* add macos handling for totalSystemMemory * fix return type cast for .freebsd in totalSystemMemory * add handling for the whole Darwin family in totalSystemMemory
2025-08-25os.linux: faccessat wrapper prefer to faccessat syscall when flags is zero.Qun He
This make `fs.Dir.access` has compatibility like the zig version before. With this change the `zig build --search-prefix` command would work again like the zig 0.14 version when used on Ubuntu22.04, kernel version 5.4.
2025-08-25std: add a Deque data structureIsaac Freund
This is my penance for baiting andrew into deleting the existing generic queue data structures with my talk of "too many ring buffers". The new Reader and Writer interfaces are excellent ring buffers for many use cases, but a generic queue container type is now missing. This new double-ended queue, known more succinctly as a deque, is implemented from scratch based on the API design lessons learned from ArrayList over the years. The API is not yet as featureful as ArrayList, but the core functionality is in place and I will be using this in my personal projects shortly. I think it makes sense to add further functions as needed based on real-world use-cases.
2025-08-25Adds non allocating alternatives to ZON parse functions (#22916)Mason Remaley
* Adds "flat" alternatives to zon.parse.from* that don't support pointers * Fixes documentation * Removes flat postfix from non allocating functions, adds alloc to others * Stops using alloc variant in tests where not needed
2025-08-25Fix #24999: copy left-overs before we XOR into c. (#25001)Erik Schlyter
It is important we copy the left-overs in the message *before* we XOR it into the ciphertext, because if we're encrypting in-place (i.e., m == c), we will manipulate the message that will be used for tag generation. This will generate faulty tags when message length doesn't conform with 16 byte blocks.
2025-08-25start adding big endian RISC-V supportAlex Rønne Petersen
The big endian RISC-V effort is mostly driven by MIPS (the company) which is pivoting to RISC-V, and presumably needs a big endian variant to fill the niche that big endian MIPS (the ISA) did. GCC already supports these targets, but LLVM support will only appear in 22; this commit just adds the necessary target knowledge and checks on our end.
2025-08-25delete std.debug.FixedBufferReaderAndrew Kelley
now that std.Io.Reader has sufficient debug performance
2025-08-25std.zig.system: fix check for sparc "v8+" in getExternalExecutor()Alex Rønne Petersen
Targeting v9 on sparc32 doesn't by itself imply "v8+" mode (64-bit instructions in 32-bit code).
2025-08-24lib: Reword documentation for realloc to clarify size87
"byte size" is confusing. Clarify we mean number of items.
2025-08-24Update powi.zig to fix docstring formattingBecker A.
Without this change, the docs are formatted s.t. the text "Edge case rules ordered by precedence:" is appended onto the prior line of text "Underflow: Absolute value of result smaller than 1", instead of getting its own line.
2025-08-23disable stack tracing on powerpc64Andrew Kelley
tracked by #24970
2025-08-23std.debug: delete MemoryAccessorAndrew Kelley
This API is based around the unsound idea that a process can perform checked virtual memory loads to prevent crashing. This depends on OS-specific APIs that may be unavailable, disabled, or impossible due to virtualization. It also makes collecting stack traces ridiculously slow, which is a problem for users of DebugAllocator - in other words, everybody, all the time. It also makes strace go from being superbly clean to being awful.
2025-08-23std.fs.Dir: fix updateFile() to flush the file before updating its timesAlex Rønne Petersen
AtomicFile.finish() calls flush() which renders any previous updateTimes() calls useless. Regression introduced in f2a3ac7c0534a74ee544fdf6ef9d2176a8d62389. Closes #24927.
2025-08-22Merge pull request #24926 from mrjbq7/http-fetchJohn Benediktsson
http.Client: don't forget to flush
2025-08-22chore(std.Target): explicitly set baseline only to `arm` with 3ds GasInfinity
* `arm` is the only supported tag for 3ds Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>
2025-08-22chore(std.Target): document the 3ds version rangeGasInfinity
2025-08-22feat(std.Target): add 3ds osGasInfinity
2025-08-22std: remove lossy int to float coercion on json parseRaiden1411
2025-08-21Merge pull request #24921 from Justus2308/messy-machAndrew Kelley
std.c.darwin: cleanup, expose everything in std.c
2025-08-21langref: sync with zig-spec grammar.pegIsaac Freund
2025-08-21drop NameTooLong from sysctlbynameZ error set (#24909)Sardorbek Imomaliev
2025-08-21make some compile errors aliases insteadJustus Klausecker
2025-08-21std.os.uefi: Fix typo that causes compile time error #22809"Lwazi Dube
2025-08-20Add mlock syscalls to std.c and std.posixBrandon Black
Linux already gained the relevant syscalls and consts in #24473 The basic mlock() and munlock() are fairly universal across the *nix world with a consistent interface, but are missing on wasi and windows. The mlockall() and munlockall() calls are not as widely supported as the basic ones. Notable non-implementers include darwin, haiku, and serenity (and of course wasi and windows again). mlock2() is Linux-only, as are its MLOCK flags.
2025-08-20Use readStreaming, not readPositional, for streaming file readVec on WindowsCarl Åstholm
2025-08-20wasi-libc: update to c89896107d7b57aef69dcadede47409ee4f702eeAlex Rønne Petersen
2025-08-20std.c.darwin: cleanup, expose everything in std.cJustus Klausecker
This mainly just moves stuff around. Justifications for other changes: * `KEVENT.FLAGS` is backed by `c_uint` because that's what the `kevent64` flags param takes (according to the 'latest' manpage from 2008) * `MACH_RCV_NOTIFY` is a legacy name and `MACH_RCV_OVERWRITE` is deprecated (xnu/osfmk/mach/message.h), so I removed them. They were 0 anyway and thus couldn't be represented as a packed struct field. * `MACH.RCV` and `MACH.SEND` are technically the same 'type' because they can both be supplied at the same time to `mach_msg`. I decided to still keep them separate because naming works out better that way and all flags except for `MACH_MSG_STRICT_REPLY` aren't shared anyway. Both are part of a packed union `mach_msg_option_t` which supplies a helper function to combine the two types. * `PT` is backed by `c_int` because that's what `ptrace` takes as a request arg (according to the latest manpage from 2015)
2025-08-19expose darwin.PT in std.cJustus Klausecker
2025-08-19Fix bugs in Windows readVec implementationsCarl Åstholm
2025-08-19std.Io.Writer: fix upper case hex float formattingTemariVirus
2025-08-19never advance seek position in `std.Io.Reader.peekDelimiterExclusive` (#24899)Rohlem
* extend std.Io.Reader.peekDelimiterExclusive test to repeat successful end-of-stream path (fails) * fix std.Io.Reader.peekDelimiterExclusive to not advance seek position in successful end-of-stream path
2025-08-18std.http.Client: discard response body when reusing connectionAndrew Kelley
When an error response was encountered, such as 404 not found, the body wasn't discarded, leading to the string "404 not found" being incorrectly interpreted as the next request's response. closes #24732
2025-08-18Expanded std.os.linux perf-related definitions (#24264)Giuseppe Cesarano
* Added perf_event_header definition * Added perf_event_mmap_page definition * Removed default values for perf_event_header * Fixed comments typos * Updated perf_event_attr definition * Explicit packet struct type * PERF.RECORD from struct to enum * fix typo: miscs to misc * misc as packed struct * cpu_mode as named enum * Rescoping CPU_MODE
2025-08-17http.BodyWriter: improve clarity of chunked state machineIsaac Freund
This is theoretically a bugfix as well, since it enforces the correct limit on the first write after writing the header. This theoretical bug hasn't been hit in practice though as far as I know.
2025-08-16Merge pull request #24864 from ifreund/fix-std-cmdAndrew Kelley
http.BodyWriter: handle EOF in chunkedSendFile, simplify
2025-08-16Build.Step.Run: fix missing stdin buffer and flushIsaac Freund
Writer.sendFileAll() asserts non-zero buffer capacity in the case that the fallback is hit. It also requires the caller to flush. The buffer may be bypassed as an optimization but this is not a guarantee. Also improve the Writer documentation and add an earlier assert on buffer capacity in sendFileAll().