aboutsummaryrefslogtreecommitdiff
path: root/lib/std/event/loop.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-11-30 18:48:31 -0800
committerGitHub <noreply@github.com>2021-11-30 18:48:31 -0800
commit7355a201336c8e3892427e5932fe5cdd46cf96df (patch)
tree4ccec922634586847d02f2324d0db75f25200188 /lib/std/event/loop.zig
parentdd62a6d2e8de522187fd096354e7156cca1821c5 (diff)
parent066eaa5e9cbfde172449f6d95bb884c7d86ac10c (diff)
downloadzig-7355a201336c8e3892427e5932fe5cdd46cf96df.tar.gz
zig-7355a201336c8e3892427e5932fe5cdd46cf96df.zip
Merge pull request #10055 from leecannon/allocator_refactor
Allocgate
Diffstat (limited to 'lib/std/event/loop.zig')
-rw-r--r--lib/std/event/loop.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/event/loop.zig b/lib/std/event/loop.zig
index 042c8bc3cc..23c89aabc5 100644
--- a/lib/std/event/loop.zig
+++ b/lib/std/event/loop.zig
@@ -173,12 +173,12 @@ pub const Loop = struct {
// We need at least one of these in case the fs thread wants to use onNextTick
const extra_thread_count = thread_count - 1;
const resume_node_count = std.math.max(extra_thread_count, 1);
- self.eventfd_resume_nodes = try self.arena.allocator.alloc(
+ self.eventfd_resume_nodes = try self.arena.allocator().alloc(
std.atomic.Stack(ResumeNode.EventFd).Node,
resume_node_count,
);
- self.extra_threads = try self.arena.allocator.alloc(Thread, extra_thread_count);
+ self.extra_threads = try self.arena.allocator().alloc(Thread, extra_thread_count);
try self.initOsData(extra_thread_count);
errdefer self.deinitOsData();
@@ -727,7 +727,7 @@ pub const Loop = struct {
/// with `allocator` and freed when the function returns.
/// `func` must return void and it can be an async function.
/// Yields to the event loop, running the function on the next tick.
- pub fn runDetached(self: *Loop, alloc: *mem.Allocator, comptime func: anytype, args: anytype) error{OutOfMemory}!void {
+ pub fn runDetached(self: *Loop, alloc: mem.Allocator, comptime func: anytype, args: anytype) error{OutOfMemory}!void {
if (!std.io.is_async) @compileError("Can't use runDetached in non-async mode!");
if (@TypeOf(@call(.{}, func, args)) != void) {
@compileError("`func` must not have a return value");
@@ -735,7 +735,7 @@ pub const Loop = struct {
const Wrapper = struct {
const Args = @TypeOf(args);
- fn run(func_args: Args, loop: *Loop, allocator: *mem.Allocator) void {
+ fn run(func_args: Args, loop: *Loop, allocator: mem.Allocator) void {
loop.beginOneEvent();
loop.yield();
@call(.{}, func, func_args); // compile error when called with non-void ret type