This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
pub fn main() !void { | |
var gpa = std.heap.GeneralPurposeAllocator(.{}){}; | |
defer std.debug.assert(gpa.deinit()); | |
const allocator = &gpa.allocator; | |
const num_threads = std.math.max(1, (std.Thread.getCpuCount() catch 1) / 2); | |
const epolls = try allocator.alloc(std.os.fd_t, num_threads); | |
defer allocator.free(epolls); |