code: create util.allocator and use globally

river is not a library and passing a general purpose allocators around
everywhere does not make sense and leads to ugly code. This does not
prevent us from using local arenas if they are fitting.
This commit is contained in:
Isaac Freund
2020-06-16 22:08:36 +02:00
parent fb8d855ec9
commit c5de1641dc
17 changed files with 76 additions and 86 deletions

View File

@ -95,7 +95,7 @@ pub fn deinit(self: *Self) void {
pub fn addOutput(self: *Self, wlr_output: *c.wlr_output) void {
// TODO: Handle failure
const node = self.outputs.allocateNode(self.server.allocator) catch unreachable;
const node = self.outputs.allocateNode(util.allocator) catch unreachable;
node.data.init(self, wlr_output) catch unreachable;
self.outputs.append(node);