diff options
| author | Tadeo Kondrak <me@tadeo.ca> | 2020-05-05 05:19:17 -0600 |
|---|---|---|
| committer | Tadeo Kondrak <me@tadeo.ca> | 2020-05-05 05:55:27 -0600 |
| commit | fdfdac493998a180eeffdcab66e579e7af250039 (patch) | |
| tree | 239aa11cced7ca37b35a07363ffc397177907f2e /lib | |
| parent | 2c9204032d1c839d8d577113a9c4def4b9ea9b94 (diff) | |
| download | zig-fdfdac493998a180eeffdcab66e579e7af250039.tar.gz zig-fdfdac493998a180eeffdcab66e579e7af250039.zip | |
update comments for nosuspend
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/std/dwarf.zig | 12 | ||||
| -rw-r--r-- | lib/std/event/batch.zig | 2 | ||||
| -rw-r--r-- | lib/std/fs/file.zig | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/lib/std/dwarf.zig b/lib/std/dwarf.zig index 4191d45d6d..fe40a04b9d 100644 --- a/lib/std/dwarf.zig +++ b/lib/std/dwarf.zig @@ -248,7 +248,7 @@ fn readUnitLength(in_stream: var, endian: builtin.Endian, is_64: *bool) !u64 { } } -// TODO the noasyncs here are workarounds +// TODO the nosuspends here are workarounds fn readAllocBytes(allocator: *mem.Allocator, in_stream: var, size: usize) ![]u8 { const buf = try allocator.alloc(u8, size); errdefer allocator.free(buf); @@ -256,7 +256,7 @@ fn readAllocBytes(allocator: *mem.Allocator, in_stream: var, size: usize) ![]u8 return buf; } -// TODO the noasyncs here are workarounds +// TODO the nosuspends here are workarounds fn readAddress(in_stream: var, endian: builtin.Endian, is_64: bool) !u64 { return nosuspend if (is_64) try in_stream.readInt(u64, endian) @@ -269,7 +269,7 @@ fn parseFormValueBlockLen(allocator: *mem.Allocator, in_stream: var, size: usize return FormValue{ .Block = buf }; } -// TODO the noasyncs here are workarounds +// TODO the nosuspends here are workarounds fn parseFormValueBlock(allocator: *mem.Allocator, in_stream: var, endian: builtin.Endian, size: usize) !FormValue { const block_len = try nosuspend in_stream.readVarInt(usize, endian, size); return parseFormValueBlockLen(allocator, in_stream, block_len); @@ -277,7 +277,7 @@ fn parseFormValueBlock(allocator: *mem.Allocator, in_stream: var, endian: builti fn parseFormValueConstant(allocator: *mem.Allocator, in_stream: var, signed: bool, endian: builtin.Endian, comptime size: i32) !FormValue { // TODO: Please forgive me, I've worked around zig not properly spilling some intermediate values here. - // `noasync` should be removed from all the function calls once it is fixed. + // `nosuspend` should be removed from all the function calls once it is fixed. return FormValue{ .Const = Constant{ .signed = signed, @@ -301,7 +301,7 @@ fn parseFormValueConstant(allocator: *mem.Allocator, in_stream: var, signed: boo }; } -// TODO the noasyncs here are workarounds +// TODO the nosuspends here are workarounds fn parseFormValueRef(allocator: *mem.Allocator, in_stream: var, endian: builtin.Endian, size: i32) !FormValue { return FormValue{ .Ref = switch (size) { @@ -315,7 +315,7 @@ fn parseFormValueRef(allocator: *mem.Allocator, in_stream: var, endian: builtin. }; } -// TODO the noasyncs here are workarounds +// TODO the nosuspends here are workarounds fn parseFormValue(allocator: *mem.Allocator, in_stream: var, form_id: u64, endian: builtin.Endian, is_64: bool) anyerror!FormValue { return switch (form_id) { FORM_addr => FormValue{ .Address = try readAddress(in_stream, endian, @sizeOf(usize) == 8) }, diff --git a/lib/std/event/batch.zig b/lib/std/event/batch.zig index 26c0d5fab0..9c424fcd2c 100644 --- a/lib/std/event/batch.zig +++ b/lib/std/event/batch.zig @@ -21,7 +21,7 @@ pub fn Batch( /// usual recommended option for this parameter. auto_async, - /// Always uses the `noasync` keyword when using `await` on the jobs, + /// Always uses the `nosuspend` keyword when using `await` on the jobs, /// making `add` and `wait` non-async functions. Asserts that the jobs do not suspend. never_async, diff --git a/lib/std/fs/file.zig b/lib/std/fs/file.zig index b7c575a04a..383a2be12d 100644 --- a/lib/std/fs/file.zig +++ b/lib/std/fs/file.zig @@ -66,7 +66,7 @@ pub const File = struct { lock_nonblocking: bool = false, /// Setting this to `.blocking` prevents `O_NONBLOCK` from being passed even - /// if `std.io.is_async`. It allows the use of `noasync` when calling functions + /// if `std.io.is_async`. It allows the use of `nosuspend` when calling functions /// related to opening the file, reading, writing, and locking. intended_io_mode: io.ModeOverride = io.default_mode, }; @@ -112,7 +112,7 @@ pub const File = struct { mode: Mode = default_mode, /// Setting this to `.blocking` prevents `O_NONBLOCK` from being passed even - /// if `std.io.is_async`. It allows the use of `noasync` when calling functions + /// if `std.io.is_async`. It allows the use of `nosuspend` when calling functions /// related to opening the file, reading, writing, and locking. intended_io_mode: io.ModeOverride = io.default_mode, }; |
