Andrew Kelley
1a998886c8
Merge pull request #24329 from ziglang/writergate
...
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-10 12:04:27 +02:00
triallax
5b4b033236
build runner: fix --verbose-llvm-bc= not properly accepting value
...
closes #21001
2025-07-10 11:04:29 +02:00
Andrew Kelley
40d74e4287
std: refactor to use Alignment.of
2025-07-09 23:07:18 -07:00
Andrew Kelley
36cf22c55c
std.log: adjust default level for ReleaseSmall to include info
...
it was kind of wild to not do this before. sorry!
2025-07-09 23:03:35 -07:00
Alex Rønne Petersen
820f1a23a5
std: Disable std.zon parse float on dynamic x86-linux-musl
...
https://github.com/ziglang/zig/issues/23922#issuecomment-3054296672
2025-07-10 06:52:01 +02:00
Andrew Kelley
10d6db5d7d
std.io.Writer: remove some unimplemented functions
...
YAGNI
2025-07-09 20:01:15 -07:00
Andrew Kelley
aa1bdb43e0
std.io.Writer.writeStructEndian: fix packed structs
2025-07-09 20:01:15 -07:00
Andrew Kelley
dce08d9a57
std.Build.Cache: remove debugging remnants
...
oops!
2025-07-09 20:01:15 -07:00
Andrew Kelley
55bced9563
std.fs.File.Writer: fix splat alias bug
...
same deal as previous commit
2025-07-09 20:01:15 -07:00
Andrew Kelley
9e52febeeb
std.io.Writer.writeSplatHeader: fix splat alias bug
...
pointer comparison cannot be used since the buffers may alias
2025-07-09 18:29:10 -07:00
Andrew Kelley
09cdcf67e1
std.io.Writer.writeSplat: simplify and fix
2025-07-09 17:52:36 -07:00
Andrew Kelley
ab84dcc824
std.io.Reader: make vtable contract more consistent
2025-07-09 17:30:05 -07:00
Andrew Kelley
c072cf2bb8
std.io.Reader.peekDelimiterInclusive: simplify and fix
2025-07-09 17:18:23 -07:00
Andrew Kelley
93ac76594a
std: fmt.format to io.Writer.print
...
allows reverting format -> deprecatedFormat, plus I think this is a
nicer place for the function.
2025-07-09 15:31:02 -07:00
Andrew Kelley
4d93545ded
chicken out and allow ascii string alignment
2025-07-09 15:17:07 -07:00
Andrew Kelley
2468766a89
std: forbid alignment formatting options sometimes
2025-07-09 15:07:45 -07:00
Andrew Kelley
51a9a6aab6
std: replace formatInteger with formatNumber
2025-07-09 14:54:54 -07:00
Andrew Kelley
5bc95a6fa2
wasi.c: fix pread/pwrite
...
When stream is NULL it means reads should read 0 bytes and writes should
fake success with no side effects.
2025-07-09 10:47:36 -07:00
Andrew Kelley
5c6679922d
CBE: avoid depending on std.io.Writer.count
2025-07-09 09:32:07 -07:00
Andrew Kelley
bc2cf0c173
eliminate all uses of std.io.Writer.count except for CBE
2025-07-09 09:32:07 -07:00
Alex Rønne Petersen
7c709f920b
ci: Update to QEMU 10.0.2
2025-07-09 11:06:13 +02:00
Andrew Kelley
d345a10054
std.os.freebsd.copy_file_range: add missing error.Unexpected
2025-07-08 16:53:02 -07:00
Andrew Kelley
81b0c99915
std.zig.system.linux: update API usage
2025-07-08 15:15:21 -07:00
Andrew Kelley
c1c49a7d1c
C backend: fix bitcasting regression
2025-07-08 15:15:08 -07:00
Andrew Kelley
1dcb20d27e
std.fmt: refactor to remove cacheString
...
when this kind of trick is needed, do it inline
2025-07-08 11:07:23 -07:00
Andrew Kelley
fc335a3a48
update format strings in os/windows/test.zig
2025-07-08 08:46:31 -07:00
Andrew Kelley
83c4000319
std: revert big int test to master branch
...
oops, it depends on usize
2025-07-08 08:36:04 -07:00
Andrew Kelley
db021c4fd1
CI: disable self-hosted riscv64
...
it's missing some critical features like `@fieldParentPtr` and `@memmove`
2025-07-08 08:28:20 -07:00
Andrew Kelley
5955ba4f53
std.fs.File.Writer: implement positional writing for Windows
2025-07-07 23:09:14 -07:00
Jacob Young
720cd43fc1
cbe: fix code header being omitted from the output
2025-07-07 22:43:53 -07:00
Andrew Kelley
043079d765
std.io.Writer.VectorWrapper: fix vtable not being a unique addr
2025-07-07 22:43:53 -07:00
Andrew Kelley
a983f5b90f
wasm backend: memcpy and memmove are the same
...
both lower to memory.fill operation, which are allowed to overlap
2025-07-07 22:43:53 -07:00
Andrew Kelley
c7b4b17ba2
fix test case expected float value
...
it's better now
2025-07-07 22:43:53 -07:00
Andrew Kelley
911cd2611f
Sema: fix unintentional extra @compileLog newline
2025-07-07 22:43:53 -07:00
Andrew Kelley
26659c862f
update compiler unit tests to new API
2025-07-07 22:43:53 -07:00
Andrew Kelley
b0395531d3
update autodocs and langref to new API
2025-07-07 22:43:53 -07:00
Andrew Kelley
d8e26275f2
update standalone and incremental tests to new API
2025-07-07 22:43:53 -07:00
Andrew Kelley
c873c2eed9
fix aro translate-c building from source
2025-07-07 22:43:53 -07:00
Andrew Kelley
e97a0ffb60
std.Build.Step.CheckObject: mostly revert to master branch
...
the updated code to use new std.io API is crashing
2025-07-07 22:43:53 -07:00
Andrew Kelley
f2ad3bcc1c
fix 32-bit compilation
2025-07-07 22:43:53 -07:00
Andrew Kelley
b077e2979c
std.io.Reader: fix peekByte
2025-07-07 22:43:53 -07:00
Andrew Kelley
a7387f0047
fix std.io.Writer.VectorWrapper mechanism
...
previous implementation erroneously attempted to detect whether vector
API was used via the buffer pointer. This implementation has an explicit
flag.
2025-07-07 22:43:53 -07:00
Andrew Kelley
9903587a63
std.Build.Step.Options: fix build failure
2025-07-07 22:43:53 -07:00
Andrew Kelley
fd7feed04b
std.fs.File.Writer: implement positional writing
2025-07-07 22:43:53 -07:00
Andrew Kelley
7e2a26c0c4
std.io.Writer.printValue: rework logic
...
Alignment and fill options only apply to numbers.
Rework the implementation to mainly branch on the format string rather
than the type information. This is more straightforward to maintain and
more straightforward for comptime evaluation.
Enums support being printed as decimal, hexadecimal, octal, and binary.
`formatInteger` is another possible format method that is
unconditionally called when the value type is struct and one of the
integer-printing format specifiers are used.
2025-07-07 22:43:53 -07:00
Andrew Kelley
5378fdb153
std.fmt: fully remove format string from format methods
...
Introduces `std.fmt.alt` which is a helper for calling alternate format
methods besides one named "format".
2025-07-07 22:43:53 -07:00
Andrew Kelley
4ccc6f2b57
compiler: fix remaining build failures
2025-07-07 22:43:53 -07:00
Andrew Kelley
6489907662
std.zip: work around deprecated API
2025-07-07 22:43:53 -07:00
Andrew Kelley
f4720e1407
std.testing: update to new std.io API
2025-07-07 22:43:53 -07:00
Andrew Kelley
87a7568a44
build runner: restore missing newline
2025-07-07 22:43:52 -07:00