fix: zero initialize all allocated memory

This commit is contained in:
2022-02-05 15:54:53 -04:00
parent 9159270e87
commit 78080b4682
4 changed files with 28 additions and 22 deletions

View File

@@ -7,8 +7,11 @@ buf: []u8,
alloc: Allocator,
pub fn init(alloc: Allocator) !Self {
const buf = try alloc.alloc(u8, 0x8000);
std.mem.set(u8, buf, 0);
return Self{
.buf = try alloc.alloc(u8, 0x8000),
.buf = buf,
.alloc = alloc,
};
}