Advertisement
Guest User

Untitled

a guest
Jul 10th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. const std = @import("std");
  2.  
  3. mod_alloc: *std.mem.Allocator,
  4.  
  5. pub fn init_module(allocator: *std.mem.Allocator) @This() {
  6.     return @This() {.mod_alloc = allocator };
  7. }
  8.  
  9. pub fn Vector(self: *const @This(), comptime T: type) std.ArrayList(T) {
  10.     return std.ArrayList(T).init(self.mod_alloc);
  11. }
  12.  
  13. pub fn alloc_int(self: *const @This()) !*u8 {
  14.     return self.mod_alloc.create(u8);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement