Init
This commit is contained in:
commit
184645ba63
73 changed files with 4983 additions and 0 deletions
16
src/eink_feed_server/result.zig
Normal file
16
src/eink_feed_server/result.zig
Normal file
|
@ -0,0 +1,16 @@
|
|||
const std = @import("std");
|
||||
|
||||
pub fn ResultArena(comptime T: type) type {
|
||||
return struct {
|
||||
const Self = @This();
|
||||
|
||||
arena: *std.heap.ArenaAllocator,
|
||||
value: T,
|
||||
|
||||
pub fn deinit(self: Self) void {
|
||||
const allocator = self.arena.child_allocator;
|
||||
self.arena.deinit();
|
||||
allocator.destroy(self.arena);
|
||||
}
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue