diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-11-27 13:38:49 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-27 13:38:49 -0500 |
| commit | 83c664eaa080669cff83f7c30046376f3399eafb (patch) | |
| tree | 06cccc09052be4459e924d04a867ff34a889d87c /src-self-hosted/libc_installation.zig | |
| parent | 63300a21ddf4cfe209a39796c6d7ea7773e14fd6 (diff) | |
| parent | 4d8a8e65df79ddd5edf52f961552036ccfca6e8e (diff) | |
| download | zig-83c664eaa080669cff83f7c30046376f3399eafb.tar.gz zig-83c664eaa080669cff83f7c30046376f3399eafb.zip | |
Merge pull request #3780 from Vexu/stage2-async-review
Update use of async functions in self hosted compiler
Diffstat (limited to 'src-self-hosted/libc_installation.zig')
| -rw-r--r-- | src-self-hosted/libc_installation.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src-self-hosted/libc_installation.zig b/src-self-hosted/libc_installation.zig index 42e7de5d08..71cec00eba 100644 --- a/src-self-hosted/libc_installation.zig +++ b/src-self-hosted/libc_installation.zig @@ -143,7 +143,7 @@ pub const LibCInstallation = struct { } /// Finds the default, native libc. - pub async fn findNative(self: *LibCInstallation, allocator: *Allocator) !void { + pub fn findNative(self: *LibCInstallation, allocator: *Allocator) !void { self.initEmpty(); var group = event.Group(FindError!void).init(allocator); errdefer group.wait() catch {}; @@ -393,14 +393,14 @@ pub const LibCInstallation = struct { }; /// caller owns returned memory -async fn ccPrintFileName(allocator: *Allocator, o_file: []const u8, want_dirname: bool) ![]u8 { +fn ccPrintFileName(allocator: *Allocator, o_file: []const u8, want_dirname: bool) ![]u8 { const cc_exe = std.os.getenv("CC") orelse "cc"; const arg1 = try std.fmt.allocPrint(allocator, "-print-file-name={}", o_file); defer allocator.free(arg1); const argv = [_][]const u8{ cc_exe, arg1 }; // TODO This simulates evented I/O for the child process exec - std.event.Loop.instance.?.yield(); + event.Loop.startCpuBoundOperation(); const errorable_result = std.ChildProcess.exec(allocator, argv, null, null, 1024 * 1024); const exec_result = if (std.debug.runtime_safety) blk: { break :blk errorable_result catch unreachable; |
