aboutsummaryrefslogtreecommitdiff
path: root/lib/std
AgeCommit message (Collapse)Author
2025-07-16remove condition codesAndrew Kelley
LLVM always assumes these are on. Zig backends do not observe them. If Zig backends want to start using them, they can be introduced, one arch at a time, with proper documentation.
2025-07-16alexrp suggestionsAndrew Kelley
2025-07-16zig fmtAndrew Kelley
2025-07-16inline assembly: use typesAndrew Kelley
until now these were stringly typed. it's kinda obvious when you think about it.
2025-07-16fix memory leakAlex Kladov
closes #24421
2025-07-16Merge pull request #24464 from ziglang/fixesAndrew Kelley
std.Io fixes, docs, and tests
2025-07-15std.os.windows: restore sendmsg, sendto, recvfromAndrew Kelley
These regressed with 1a998886c863a1829d649f196093f1058cd9cf13 I'm not ready to tackle std.posix quite yet
2025-07-15std.Io.Writer.Allocating: fix sendFile EndOfStreamAndrew Kelley
2025-07-15std.Io.Writer.Discarding: fix sendFile EndOfStreamAndrew Kelley
2025-07-15std.io.Reader: add more docs for rebaseAndrew Kelley
closes #24418
2025-07-15better default min versions for freebsd and netbsdAndrew Kelley
Without this change, by default you get a failure when trying to cross compile for these targets. freebsd was error: undefined symbol: __libc_start1 netbsd was warning: invalid target NetBSD libc version: 9.4.0 error: unable to build NetBSD libc shared objects: InvalidTargetLibCVersion now they work by default
2025-07-15Merge pull request #24454 from ziglang/packed-struct-streamsAndrew Kelley
std.Io: handle packed structs better
2025-07-15memory safety fix for Io.Writer.Allocating.toOwnedSlice*()Travis Staloch
don't forget to save the list. this allows a `testing.checkAllAllocationFailures()` test to pass in one of my projects which newly failed since #24329 was merged.
2025-07-14std.Io.Reader.streamDelimiterEnding docs clarificationAndrew Kelley
2025-07-14std.Io: handle packed structs betterAndrew Kelley
Rather than having the endian-suffixed functions be the preferred ones the unsuffixed ones are the preferred ones and the tricky functions get a special suffix. Makes packed structs read and written the same as integers. closes #12960
2025-07-14std.posix: skip flaky testAndrew Kelley
tracked by #24380
2025-07-14std.c: add missing netbsd and freebsd MSG flagsAndrew Kelley
2025-07-14std.fs.File.Reader.seekTo: add missing int castAndrew Kelley
2025-07-14std.Io.Writer.Discarding: fix drain calculationAndrew Kelley
2025-07-14std.net: wasi does not have unix socketsAndrew Kelley
2025-07-14align those `@fieldParentPtr` castsAndrew Kelley
2025-07-14make msghdr.iovlen unsignedAndrew Kelley
I don't care what C headers say. This value is never supposed to be negative.
2025-07-14std.net: update to new I/O APIAndrew Kelley
2025-07-14std.Io.Reader.appendRemaining: add missing assertAndrew Kelley
2025-07-14add adaptToNewApi to std.Io.Reader as wellAndrew Kelley
2025-07-14std.crypto: fix Sha1 namespaceAndrew Kelley
2025-07-14fix some llvm ir printer bugsxdBronch
2025-07-14Add setsid to std.(c|posix)Brandon Black
The interface and errors for this seem to be very universal and generic. Note Linux already has this defined as a syscall as well.
2025-07-13std.crypto: remove `inline` from most functionsAndrew Kelley
To quote the language reference, It is generally better to let the compiler decide when to inline a function, except for these scenarios: * To change how many stack frames are in the call stack, for debugging purposes. * To force comptime-ness of the arguments to propagate to the return value of the function, as in the above example. * Real world performance measurements demand it. Don't guess! Note that inline actually restricts what the compiler is allowed to do. This can harm binary size, compilation speed, and even runtime performance. `zig run lib/std/crypto/benchmark.zig -OReleaseFast` [-before-] vs {+after+} md5: [-990-] {+998+} MiB/s sha1: [-1144-] {+1140+} MiB/s sha256: [-2267-] {+2275+} MiB/s sha512: [-762-] {+767+} MiB/s sha3-256: [-680-] {+683+} MiB/s sha3-512: [-362-] {+363+} MiB/s shake-128: [-835-] {+839+} MiB/s shake-256: [-680-] {+681+} MiB/s turboshake-128: [-1567-] {+1570+} MiB/s turboshake-256: [-1276-] {+1282+} MiB/s blake2s: [-778-] {+789+} MiB/s blake2b: [-1071-] {+1086+} MiB/s blake3: [-1148-] {+1137+} MiB/s ghash: [-10044-] {+10033+} MiB/s polyval: [-9726-] {+10033+} MiB/s poly1305: [-2486-] {+2703+} MiB/s hmac-md5: [-991-] {+998+} MiB/s hmac-sha1: [-1134-] {+1137+} MiB/s hmac-sha256: [-2265-] {+2288+} MiB/s hmac-sha512: [-765-] {+764+} MiB/s siphash-2-4: [-4410-] {+4438+} MiB/s siphash-1-3: [-7144-] {+7225+} MiB/s siphash128-2-4: [-4397-] {+4449+} MiB/s siphash128-1-3: [-7281-] {+7374+} MiB/s aegis-128x4 mac: [-73385-] {+74523+} MiB/s aegis-256x4 mac: [-30160-] {+30539+} MiB/s aegis-128x2 mac: [-66662-] {+67267+} MiB/s aegis-256x2 mac: [-16812-] {+16806+} MiB/s aegis-128l mac: [-33876-] {+34055+} MiB/s aegis-256 mac: [-8993-] {+9087+} MiB/s aes-cmac: 2036 MiB/s x25519: [-20670-] {+16844+} exchanges/s ed25519: [-29763-] {+29576+} signatures/s ecdsa-p256: [-4762-] {+4900+} signatures/s ecdsa-p384: [-1465-] {+1500+} signatures/s ecdsa-secp256k1: [-5643-] {+5769+} signatures/s ed25519: [-21926-] {+21721+} verifications/s ed25519: [-51200-] {+50880+} verifications/s (batch) chacha20Poly1305: [-1189-] {+1109+} MiB/s xchacha20Poly1305: [-1196-] {+1107+} MiB/s xchacha8Poly1305: [-1466-] {+1555+} MiB/s xsalsa20Poly1305: [-660-] {+620+} MiB/s aegis-128x4: [-76389-] {+78181+} MiB/s aegis-128x2: [-53946-] {+53495+} MiB/s aegis-128l: [-27219-] {+25621+} MiB/s aegis-256x4: [-49351-] {+49542+} MiB/s aegis-256x2: [-32390-] {+32366+} MiB/s aegis-256: [-8881-] {+8944+} MiB/s aes128-gcm: [-6095-] {+6205+} MiB/s aes256-gcm: [-5306-] {+5427+} MiB/s aes128-ocb: [-8529-] {+13974+} MiB/s aes256-ocb: [-7241-] {+9442+} MiB/s isapa128a: [-204-] {+214+} MiB/s aes128-single: [-133857882-] {+134170944+} ops/s aes256-single: [-96306962-] {+96408639+} ops/s aes128-8: [-1083210101-] {+1073727253+} ops/s aes256-8: [-762042466-] {+767091778+} ops/s bcrypt: 0.009 s/ops scrypt: [-0.018-] {+0.017+} s/ops argon2: [-0.037-] {+0.060+} s/ops kyber512d00: [-206057-] {+205779+} encaps/s kyber768d00: [-156074-] {+150711+} encaps/s kyber1024d00: [-116626-] {+115469+} encaps/s kyber512d00: [-181149-] {+182046+} decaps/s kyber768d00: [-136965-] {+135676+} decaps/s kyber1024d00: [-101307-] {+100643+} decaps/s kyber512d00: [-123624-] {+123375+} keygen/s kyber768d00: [-69465-] {+70828+} keygen/s kyber1024d00: [-43117-] {+43208+} keygen/s
2025-07-13Add documentation to std.crypto.aes_gcm.AesGcm.encrypt (#24427)Marcos Gutiérrez Alonso
2025-07-12std.Io.Reader: encourage inlining hot buffer checkmlugg
Resolves: #24424
2025-07-12std.os.uefi.tables: ziggify boot and runtime services (#23441)Carmen
* std.os.uefi.tables: ziggify boot and runtime services * avoid T{} syntax Co-authored-by: linusg <mail@linusgroh.de> * misc fixes * work * self-review quickfixes * dont make MemoryMapSlice generic * more review fixes, work * more work * more work * review fixes * update boot/runtime services references throughout codebase * self-review fixes * couple of fixes i forgot to commit earlier * fixes from integrating in my own project * fixes from refAllDeclsRecursive * Apply suggestions from code review Co-authored-by: truemedian <truemedian@gmail.com> * more fixes from review * fixes from project integration * make natural alignment of Guid align-8 * EventRegistration is a new opaque type * fix getNextHighMonotonicCount * fix locateProtocol * fix exit * partly revert 7372d65 * oops exit data_len is num of bytes * fixes from project integration * MapInfo consistency, MemoryType update per review * turn EventRegistration back into a pointer * forgot to finish updating MemoryType methods * fix IntFittingRange calls * set uefi.Page nat alignment * Back out "set uefi.Page nat alignment" This backs out commit cdd9bd6f7f5fb763f994b8fbe3e1a1c2996a2393. * get rid of some error.NotFound-s * fix .exit call in panic * review comments, add format method * fix resetSystem data alignment * oops, didnt do a final refAllDeclsRecursive i guess * review comments * writergate update MemoryType.format * fix rename --------- Co-authored-by: linusg <mail@linusgroh.de> Co-authored-by: truemedian <truemedian@gmail.com>
2025-07-12std.Build.Step.Run: Set WINEDEBUG=-all for -fwine by default.Alex Rønne Petersen
This silences the excessive default stderr logging from Wine. The user can still override this by setting WINEDEBUG in the environment; this just provides a more sensible default. Closes #24139.
2025-07-11std: Fix `Io.Reader.Limited` and add testmochalins
2025-07-11std.posix.send: should expect ConnectionRefusedAtlas Yu
Closes: #20219
2025-07-11Merge pull request #24394 from ziglang/fixesAndrew Kelley
buffering fixes
2025-07-11Remove numerous things deprecated during the 0.14 release cycleLinus Groh
Basically everything that has a direct replacement or no uses left. Notable omissions: - std.ArrayHashMap: Too much fallout, needs a separate cleanup. - std.debug.runtime_safety: Too much fallout. - std.heap.GeneralPurposeAllocator: Lots of references to it remain, not a simple find and replace as "debug allocator" is not equivalent to "general purpose allocator". - std.io.Reader: Is being reworked at the moment. - std.unicode.utf8Decode(): No replacement, needs a new API first. - Manifest backwards compat options: Removal would break test data used by TestFetchBuilder. - panic handler needs to be a namespace: Many tests still rely on it being a function, needs a separate cleanup.
2025-07-11fixed .fixed flush recursionAnton Serov
2025-07-10std: add some missing doc commentsAndrew Kelley
2025-07-10std.debug.print: provide a small bufferAndrew Kelley
2025-07-10std.log.defaultLog: provide a small bufferAndrew Kelley
2025-07-11std: rename `io` to `Io` in preparationAndrew Kelley
This commit is non-breaking. std.io is deprecated in favor of std.Io, in preparation for that namespace becoming an interface.
2025-07-10Merge pull request #24387 from ziglang/std.log.default_levelAndrew Kelley
std.log: adjust default level for ReleaseSmall to include info + bonus cleanup
2025-07-10Merge pull request #24329 from ziglang/writergateAndrew Kelley
Deprecates all existing std.io readers and writers in favor of the newly provided std.io.Reader and std.io.Writer which are non-generic and have the buffer above the vtable - in other words the buffer is in the interface, not the implementation. This means that although Reader and Writer are no longer generic, they are still transparent to optimization; all of the interface functions have a concrete hot path operating on the buffer, and only make vtable calls when the buffer is full.
2025-07-09std: refactor to use Alignment.ofAndrew Kelley
2025-07-09std.log: adjust default level for ReleaseSmall to include infoAndrew Kelley
it was kind of wild to not do this before. sorry!
2025-07-10std: Disable `std.zon parse float` on dynamic x86-linux-muslAlex Rønne Petersen
https://github.com/ziglang/zig/issues/23922#issuecomment-3054296672
2025-07-09std.io.Writer: remove some unimplemented functionsAndrew Kelley
YAGNI
2025-07-09std.io.Writer.writeStructEndian: fix packed structsAndrew Kelley
2025-07-09std.Build.Cache: remove debugging remnantsAndrew Kelley
oops!