| ... | @@ -248,7 +248,7 @@ fn readUnitLength(in_stream: var, endian: builtin.Endian, is_64: *bool) !u64 { | ... | @@ -248,7 +248,7 @@ fn readUnitLength(in_stream: var, endian: builtin.Endian, is_64: *bool) !u64 { |
| 248 | } | 248 | } |
| 249 | } | 249 | } |
| 250 | | 250 | |
| 251 | // TODO the noasyncs here are workarounds | 251 | // TODO the nosuspends here are workarounds |
| 252 | fn readAllocBytes(allocator: *mem.Allocator, in_stream: var, size: usize) ![]u8 { | 252 | fn readAllocBytes(allocator: *mem.Allocator, in_stream: var, size: usize) ![]u8 { |
| 253 | const buf = try allocator.alloc(u8, size); | 253 | const buf = try allocator.alloc(u8, size); |
| 254 | errdefer allocator.free(buf); | 254 | errdefer allocator.free(buf); |
| ... | @@ -256,7 +256,7 @@ fn readAllocBytes(allocator: *mem.Allocator, in_stream: var, size: usize) ![]u8 | ... | @@ -256,7 +256,7 @@ fn readAllocBytes(allocator: *mem.Allocator, in_stream: var, size: usize) ![]u8 |
| 256 | return buf; | 256 | return buf; |
| 257 | } | 257 | } |
| 258 | | 258 | |
| 259 | // TODO the noasyncs here are workarounds | 259 | // TODO the nosuspends here are workarounds |
| 260 | fn readAddress(in_stream: var, endian: builtin.Endian, is_64: bool) !u64 { | 260 | fn readAddress(in_stream: var, endian: builtin.Endian, is_64: bool) !u64 { |
| 261 | return nosuspend if (is_64) | 261 | return nosuspend if (is_64) |
| 262 | try in_stream.readInt(u64, endian) | 262 | try in_stream.readInt(u64, endian) |
| ... | @@ -269,7 +269,7 @@ fn parseFormValueBlockLen(allocator: *mem.Allocator, in_stream: var, size: usize | ... | @@ -269,7 +269,7 @@ fn parseFormValueBlockLen(allocator: *mem.Allocator, in_stream: var, size: usize |
| 269 | return FormValue{ .Block = buf }; | 269 | return FormValue{ .Block = buf }; |
| 270 | } | 270 | } |
| 271 | | 271 | |
| 272 | // TODO the noasyncs here are workarounds | 272 | // TODO the nosuspends here are workarounds |
| 273 | fn parseFormValueBlock(allocator: *mem.Allocator, in_stream: var, endian: builtin.Endian, size: usize) !FormValue { | 273 | fn parseFormValueBlock(allocator: *mem.Allocator, in_stream: var, endian: builtin.Endian, size: usize) !FormValue { |
| 274 | const block_len = try nosuspend in_stream.readVarInt(usize, endian, size); | 274 | const block_len = try nosuspend in_stream.readVarInt(usize, endian, size); |
| 275 | return parseFormValueBlockLen(allocator, in_stream, block_len); | 275 | return parseFormValueBlockLen(allocator, in_stream, block_len); |
| ... | @@ -277,7 +277,7 @@ fn parseFormValueBlock(allocator: *mem.Allocator, in_stream: var, endian: builti | ... | @@ -277,7 +277,7 @@ fn parseFormValueBlock(allocator: *mem.Allocator, in_stream: var, endian: builti |
| 277 | | 277 | |
| 278 | fn parseFormValueConstant(allocator: *mem.Allocator, in_stream: var, signed: bool, endian: builtin.Endian, comptime size: i32) !FormValue { | 278 | fn parseFormValueConstant(allocator: *mem.Allocator, in_stream: var, signed: bool, endian: builtin.Endian, comptime size: i32) !FormValue { |
| 279 | // TODO: Please forgive me, I've worked around zig not properly spilling some intermediate values here. | 279 | // 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. |
| 281 | return FormValue{ | 281 | return FormValue{ |
| 282 | .Const = Constant{ | 282 | .Const = Constant{ |
| 283 | .signed = signed, | 283 | .signed = signed, |
| ... | @@ -301,7 +301,7 @@ fn parseFormValueConstant(allocator: *mem.Allocator, in_stream: var, signed: boo | ... | @@ -301,7 +301,7 @@ fn parseFormValueConstant(allocator: *mem.Allocator, in_stream: var, signed: boo |
| 301 | }; | 301 | }; |
| 302 | } | 302 | } |
| 303 | | 303 | |
| 304 | // TODO the noasyncs here are workarounds | 304 | // TODO the nosuspends here are workarounds |
| 305 | fn parseFormValueRef(allocator: *mem.Allocator, in_stream: var, endian: builtin.Endian, size: i32) !FormValue { | 305 | fn parseFormValueRef(allocator: *mem.Allocator, in_stream: var, endian: builtin.Endian, size: i32) !FormValue { |
| 306 | return FormValue{ | 306 | return FormValue{ |
| 307 | .Ref = switch (size) { | 307 | .Ref = switch (size) { |
| ... | @@ -315,7 +315,7 @@ fn parseFormValueRef(allocator: *mem.Allocator, in_stream: var, endian: builtin. | ... | @@ -315,7 +315,7 @@ fn parseFormValueRef(allocator: *mem.Allocator, in_stream: var, endian: builtin. |
| 315 | }; | 315 | }; |
| 316 | } | 316 | } |
| 317 | | 317 | |
| 318 | // TODO the noasyncs here are workarounds | 318 | // TODO the nosuspends here are workarounds |
| 319 | fn parseFormValue(allocator: *mem.Allocator, in_stream: var, form_id: u64, endian: builtin.Endian, is_64: bool) anyerror!FormValue { | 319 | fn parseFormValue(allocator: *mem.Allocator, in_stream: var, form_id: u64, endian: builtin.Endian, is_64: bool) anyerror!FormValue { |
| 320 | return switch (form_id) { | 320 | return switch (form_id) { |
| 321 | FORM_addr => FormValue{ .Address = try readAddress(in_stream, endian, @sizeOf(usize) == 8) }, | 321 | FORM_addr => FormValue{ .Address = try readAddress(in_stream, endian, @sizeOf(usize) == 8) }, |