feat: implement resetting

This commit is contained in:
2023-03-10 02:27:31 -06:00
parent bd872ee1c0
commit f8477714ae
7 changed files with 51 additions and 9 deletions

View File

@@ -37,6 +37,10 @@ pub fn init(allocator: Allocator) !Self {
return Self{ .buf = buf, .allocator = allocator };
}
pub fn reset(self: *Self) void {
std.mem.set(u8, self.buf, 0);
}
pub fn deinit(self: *Self) void {
self.allocator.free(self.buf);
self.* = undefined;