Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const std = @import("std");
- mod_alloc: *std.mem.Allocator,
- pub fn init_module(allocator: *std.mem.Allocator) @This() {
- return @This() {.mod_alloc = allocator };
- }
- pub fn Vector(self: *const @This(), comptime T: type) std.ArrayList(T) {
- return std.ArrayList(T).init(self.mod_alloc);
- }
- pub fn alloc_int(self: *const @This()) !*u8 {
- return self.mod_alloc.create(u8);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement