| ... | @@ -31,7 +31,7 @@ pub const Allocator = struct { | ... | @@ -31,7 +31,7 @@ pub const Allocator = struct { |
| 31 | /// Guaranteed: `old_mem.len` is the same as what was returned from `allocFn` or `reallocFn` | 31 | /// Guaranteed: `old_mem.len` is the same as what was returned from `allocFn` or `reallocFn` |
| 32 | freeFn: fn (self: *Allocator, old_mem: []u8) void, | 32 | freeFn: fn (self: *Allocator, old_mem: []u8) void, |
| 33 | | 33 | |
| 34 | /// Call destroy with the result | 34 | /// Call `destroy` with the result |
| 35 | pub fn create(self: *Allocator, init: var) Error!*@typeOf(init) { | 35 | pub fn create(self: *Allocator, init: var) Error!*@typeOf(init) { |
| 36 | const T = @typeOf(init); | 36 | const T = @typeOf(init); |
| 37 | if (@sizeOf(T) == 0) return &{}; | 37 | if (@sizeOf(T) == 0) return &{}; |
| ... | @@ -41,8 +41,8 @@ pub const Allocator = struct { | ... | @@ -41,8 +41,8 @@ pub const Allocator = struct { |
| 41 | return ptr; | 41 | return ptr; |
| 42 | } | 42 | } |
| 43 | | 43 | |
| 44 | /// Alias of create | 44 | /// Alias of `create` |
| 45 | /// Call destroy with the result | 45 | /// Call `destroy` with the result |
| 46 | pub fn construct(self: *Allocator, init: var) Error!*@typeOf(init) { | 46 | pub fn construct(self: *Allocator, init: var) Error!*@typeOf(init) { |
| 47 | return self.create(init); | 47 | return self.create(init); |
| 48 | } | 48 | } |