Skip to content

Commit

Permalink
fallback: use stackFallback allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloudef committed Jun 21, 2024
1 parent 4837914 commit 09c4e5c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/aio/Fallback.zig
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ pub fn complete(self: *@This(), mode: aio.Dynamic.CompletionMode) aio.Error!aio.
}

pub fn immediate(comptime len: u16, work: anytype) aio.Error!u16 {
var mem: [len * 1024]u8 = undefined;
var fba = std.heap.FixedBufferAllocator.init(&mem);
var wrk = try init(fba.allocator(), len);
defer wrk.deinit(fba.allocator());
var sfb = std.heap.stackFallback(len * 1024, std.heap.page_allocator);
const allocator = sfb.get();
var wrk = try init(allocator, len);
defer wrk.deinit(allocator);
try wrk.queue(len, work);
var n: u16 = len;
var num_errors: u16 = 0;
Expand Down

0 comments on commit 09c4e5c

Please sign in to comment.