authorgravatar for me@tadeo.caTadeo Kondrak <me@tadeo.ca> 2020-05-05 05:19:17-06:00
committergravatar for me@tadeo.caTadeo Kondrak <me@tadeo.ca> 2020-05-05 05:55:27-06:00
logfdfdac493998a180eeffdcab66e579e7af250039
tree239aa11cced7ca37b35a07363ffc397177907f2e
parent2c9204032d1c839d8d577113a9c4def4b9ea9b94
signaturelock-open Commit is signed but in an unrecognized format.

update comments for nosuspend


3 files changed, 9 insertions(+), 9 deletions(-)

lib/std/dwarf.zig+6-6
......@@ -248,7 +248,7 @@ fn readUnitLength(in_stream: var, endian: builtin.Endian, is_64: *bool) !u64 {
248248 }
249249}
250250
251// TODO the noasyncs here are workarounds
251// TODO the nosuspends here are workarounds
252252fn readAllocBytes(allocator: *mem.Allocator, in_stream: var, size: usize) ![]u8 {
253253 const buf = try allocator.alloc(u8, size);
254254 errdefer allocator.free(buf);
......@@ -256,7 +256,7 @@ fn readAllocBytes(allocator: *mem.Allocator, in_stream: var, size: usize) ![]u8
256256 return buf;
257257}
258258
259// TODO the noasyncs here are workarounds
259// TODO the nosuspends here are workarounds
260260fn readAddress(in_stream: var, endian: builtin.Endian, is_64: bool) !u64 {
261261 return nosuspend if (is_64)
262262 try in_stream.readInt(u64, endian)
......@@ -269,7 +269,7 @@ fn parseFormValueBlockLen(allocator: *mem.Allocator, in_stream: var, size: usize
269269 return FormValue{ .Block = buf };
270270}
271271
272// TODO the noasyncs here are workarounds
272// TODO the nosuspends here are workarounds
273273fn parseFormValueBlock(allocator: *mem.Allocator, in_stream: var, endian: builtin.Endian, size: usize) !FormValue {
274274 const block_len = try nosuspend in_stream.readVarInt(usize, endian, size);
275275 return parseFormValueBlockLen(allocator, in_stream, block_len);
......@@ -277,7 +277,7 @@ fn parseFormValueBlock(allocator: *mem.Allocator, in_stream: var, endian: builti
277277
278278fn parseFormValueConstant(allocator: *mem.Allocator, in_stream: var, signed: bool, endian: builtin.Endian, comptime size: i32) !FormValue {
279279 // TODO: Please forgive me, I've worked around zig not properly spilling some intermediate values here.
280 // `noasync` should be removed from all the function calls once it is fixed.
280 // `nosuspend` should be removed from all the function calls once it is fixed.
281281 return FormValue{
282282 .Const = Constant{
283283 .signed = signed,
......@@ -301,7 +301,7 @@ fn parseFormValueConstant(allocator: *mem.Allocator, in_stream: var, signed: boo
301301 };
302302}
303303
304// TODO the noasyncs here are workarounds
304// TODO the nosuspends here are workarounds
305305fn parseFormValueRef(allocator: *mem.Allocator, in_stream: var, endian: builtin.Endian, size: i32) !FormValue {
306306 return FormValue{
307307 .Ref = switch (size) {
......@@ -315,7 +315,7 @@ fn parseFormValueRef(allocator: *mem.Allocator, in_stream: var, endian: builtin.
315315 };
316316}
317317
318// TODO the noasyncs here are workarounds
318// TODO the nosuspends here are workarounds
319319fn parseFormValue(allocator: *mem.Allocator, in_stream: var, form_id: u64, endian: builtin.Endian, is_64: bool) anyerror!FormValue {
320320 return switch (form_id) {
321321 FORM_addr => FormValue{ .Address = try readAddress(in_stream, endian, @sizeOf(usize) == 8) },
lib/std/event/batch.zig+1-1
......@@ -21,7 +21,7 @@ pub fn Batch(
2121 /// usual recommended option for this parameter.
2222 auto_async,
2323
24 /// Always uses the `noasync` keyword when using `await` on the jobs,
24 /// Always uses the `nosuspend` keyword when using `await` on the jobs,
2525 /// making `add` and `wait` non-async functions. Asserts that the jobs do not suspend.
2626 never_async,
2727
lib/std/fs/file.zig+2-2
......@@ -66,7 +66,7 @@ pub const File = struct {
6666 lock_nonblocking: bool = false,
6767
6868 /// Setting this to `.blocking` prevents `O_NONBLOCK` from being passed even
69 /// if `std.io.is_async`. It allows the use of `noasync` when calling functions
69 /// if `std.io.is_async`. It allows the use of `nosuspend` when calling functions
7070 /// related to opening the file, reading, writing, and locking.
7171 intended_io_mode: io.ModeOverride = io.default_mode,
7272 };
......@@ -112,7 +112,7 @@ pub const File = struct {
112112 mode: Mode = default_mode,
113113
114114 /// Setting this to `.blocking` prevents `O_NONBLOCK` from being passed even
115 /// if `std.io.is_async`. It allows the use of `noasync` when calling functions
115 /// if `std.io.is_async`. It allows the use of `nosuspend` when calling functions
116116 /// related to opening the file, reading, writing, and locking.
117117 intended_io_mode: io.ModeOverride = io.default_mode,
118118 };