Andrew Kelley
988f58341b
std.Io: introduce cancellation
2025-07-20 10:38:38 -07:00
Jacob Young
90cc7f4adf
EventLoop: fix futex usage
...
How silly of me to forget that the kernel doesn't implement its own API.
The scheduling is not great, but at least doesn't deadlock or hammer.
2025-07-20 10:38:38 -07:00
Jacob Young
4f214b97ec
EventLoop: get file operations working
...
Something is horribly wrong with scheduling, as can be seen in the
debug output, but at least it somehow manages to exit cleanly...
2025-07-20 10:38:38 -07:00
Andrew Kelley
50724cf1c3
WIP
2025-07-20 10:38:38 -07:00
Jacob Young
1216e807ac
EventLoop: move context after the async closure
...
This avoids needing to store more sizes and alignments. Only the result
alignment needs to be stored, because `Fiber` is at a fixed zero offset.
2025-07-20 10:38:38 -07:00
Jacob Young
048a40dac7
EventLoop: fix incorrect alignment panic
...
When the previous fiber did not request to be registered as an awaiter,
it may not have actually been a full blown `Fiber`, so only create the
`Fiber` pointer when needed.
2025-07-20 10:38:38 -07:00
Andrew Kelley
1d7a69cb7d
update threaded fibers impl to actually storing args
...
sorry, something still not working correctly
2025-07-20 10:38:38 -07:00
Andrew Kelley
ad3c5f0292
fix context passing in threaded Io impl
2025-07-20 10:38:38 -07:00
Jacob Young
0c1f5dbd64
EventLoop: implement main idle fiber
2025-07-20 10:38:38 -07:00
Jacob Young
c7b406f2ad
EventLoop: add threads
2025-07-20 10:38:38 -07:00
Jacob Young
03bb08d337
EventLoop: rewrite context switching
2025-07-20 10:38:38 -07:00
Jacob Young
93054125fe
EventLoop: prepare for threading
2025-07-20 10:38:38 -07:00
Andrew Kelley
07ee4977da
demo: single-threaded green threads implementation
2025-07-20 10:38:38 -07:00
Andrew Kelley
8373788c4c
Merge pull request #24488 from ziglang/more
...
std.zig: finish updating to new I/O API
2025-07-20 11:24:41 +02:00
Marc Tiehuis
4780cc50cf
std.Io.Writer: support alignment for {t} specifier
2025-07-20 10:30:17 +02:00
Andrew Kelley
c40fb96ca3
std.Io.Writer: fix writeSliceSwap
...
tried to be too clever, wrote bad code
2025-07-19 22:12:37 -07:00
Andrew Kelley
8489bab1f4
std.Io.Writer: add missing writeSliceSwap
2025-07-19 19:57:37 -07:00
Andrew Kelley
a288266f33
std.Io.Reader: remove aggressive assert from fill
...
with `.fixed("")` you should still be able to do `fill(1)` and have it
return error.EndOfStream.
2025-07-19 16:05:01 -07:00
John Benediktsson
e62e42f0d9
std.io.Writer: remove requirement of a 2-byte buffer for extern unions ( #24489 )
...
closes #24486
2025-07-17 16:42:53 +00:00
Andrew Kelley
5784500572
std.Io.Reader: fix readSliceShort with smaller buffer than Reader
...
closes #24443
2025-07-17 09:26:31 -07:00
Andrew Kelley
86699acbb9
std.Io.Reader: update OneByteReader usage to std.testing.Reader
2025-07-17 09:26:31 -07:00
John Benediktsson
6e86910e19
std.Io: Fix GenericReader.adaptToNewApi; add DeprecatedReader.adaptToNewApi ( #24484 )
2025-07-17 11:29:22 +00:00
Andrew Kelley
70f514f1ba
std.Io.Reader: fix appendRemaining harder
...
ensure that it issues a stream call that includes the buffer to detect
the end when needed, but otherwise does not offer Reader buffer to
append directly to the list.
2025-07-16 17:20:03 -07:00
Andrew Kelley
73cfba4d0d
std.Io.Writer: fix writeStruct
2025-07-16 17:20:03 -07:00
Andrew Kelley
e7a639967e
std.Io.Reader: fix appendRemaining
...
it calls readVec which is a higher level function than was expected in
the previous implementation
2025-07-16 17:20:03 -07:00
Andrew Kelley
c4776d66af
update compiler
2025-07-16 17:20:02 -07:00
Andrew Kelley
2d5d2ba4f5
std.zig.Render: update it and references
2025-07-16 17:20:02 -07:00
Silver
d772c06272
fix splatBytesAll and writeSplatAll
2025-07-16 20:37:38 +02:00
Andrew Kelley
6d39c29564
std.Io.Writer.Allocating: fix sendFile EndOfStream
2025-07-15 11:43:55 -07:00
Andrew Kelley
c7f332a260
std.Io.Writer.Discarding: fix sendFile EndOfStream
2025-07-15 11:32:40 -07:00
Andrew Kelley
f521aa0520
std.io.Reader: add more docs for rebase
...
closes #24418
2025-07-15 10:04:45 -07:00
Andrew Kelley
a5dbb656b1
Merge pull request #24454 from ziglang/packed-struct-streams
...
std.Io: handle packed structs better
2025-07-15 13:43:08 +02:00
Travis Staloch
294db62d92
memory safety fix for Io.Writer.Allocating.toOwnedSlice*()
...
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-15 08:49:54 +02:00
Andrew Kelley
4f5fa959aa
std.Io.Reader.streamDelimiterEnding docs clarification
2025-07-14 21:01:40 -07:00
Andrew Kelley
deb9f3e88f
std.Io: handle packed structs better
...
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-14 18:43:56 -07:00
Andrew Kelley
524e2e19a5
std.Io.Writer.Discarding: fix drain calculation
2025-07-14 00:18:13 -07:00
Andrew Kelley
9a1f4cb011
std.net: update to new I/O API
2025-07-14 00:16:49 -07:00
Andrew Kelley
5496901e71
std.Io.Reader.appendRemaining: add missing assert
2025-07-14 00:14:21 -07:00
mlugg
549a466dd1
std.Io.Reader: encourage inlining hot buffer check
...
Resolves : #24424
2025-07-12 23:52:13 +02:00
mochalins
61eff7b6dd
std: Fix Io.Reader.Limited and add test
2025-07-11 17:46:14 +02:00
Andrew Kelley
b60e9f2e85
Merge pull request #24394 from ziglang/fixes
...
buffering fixes
2025-07-11 10:56:24 +02:00
Anton Serov
d83b95cbf4
fixed .fixed flush recursion
2025-07-11 05:17:31 +02:00
Andrew Kelley
e255415498
std: add some missing doc comments
2025-07-10 16:52:29 -07:00
Andrew Kelley
5360968e03
std: rename io to Io in preparation
...
This commit is non-breaking.
std.io is deprecated in favor of std.Io, in preparation for that
namespace becoming an interface.
2025-07-11 01:16:27 +02:00