From 9cd3a3ceeb85855faad670c1438d07e5eff03a0d Mon Sep 17 00:00:00 2001 From: namedkitten Date: Fri, 10 Jul 2020 03:25:23 +0100 Subject: [PATCH] commit treeson with the ground --- src/main.zig | 13 +++++-------- src/widgets/battery/battery.zig | 1 - 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main.zig b/src/main.zig index 5d043b4..d813c5b 100644 --- a/src/main.zig +++ b/src/main.zig @@ -25,14 +25,11 @@ pub fn main() !void { var br = Bar.init(&bar); const widgets = [_]*Widget{ - &Widget.init(&textWidget.New("owo", "potato")), - &Widget.init(&textWidget.New("uwu", "tomato")), - &Widget.init(&weatherWidget.New(allocator, &br, "London")), - &Widget.init(&batteryWidget.New(allocator, &br)), - &Widget.init(&timeWidget.New(allocator, &br)), - - //&Widget.init(&weatherWidget.New(allocator, &br, "Oxford")), - //&Widget.init(&weatherWidget.New(allocator, &br, "Newcastle")), + &Widget.init(&textWidget.New("owo", "potato")), // 4KiB + &Widget.init(&textWidget.New("uwu", "tomato")), // 4KiB + &Widget.init(&weatherWidget.New(allocator, &br, "London")), // 16KiB + &Widget.init(&batteryWidget.New(allocator, &br)), // 756.15KiB + &Widget.init(&timeWidget.New(allocator, &br)), // 32.46KiB }; bar.widgets = widgets[0..]; try br.start(); diff --git a/src/widgets/battery/battery.zig b/src/widgets/battery/battery.zig index e581d5d..02b084f 100644 --- a/src/widgets/battery/battery.zig +++ b/src/widgets/battery/battery.zig @@ -53,7 +53,6 @@ pub const BatteryWidget = struct { return self.initial_info(); } pub fn get_power_paths(self: *BatteryWidget, provided_allocator: *std.mem.Allocator) anyerror!PowerPaths { - // remember that PowerPaths fields are allocated with self.allocator and will need to be freed seporately var arena = std.heap.ArenaAllocator.init(provided_allocator); defer arena.deinit(); var allocator = &arena.allocator;