std.mem.Allocator.construct: improve formatting;
This commit is contained in:
parent
4b46af4810
commit
6bd8610063
@ -31,7 +31,7 @@ pub const Allocator = struct {
|
||||
/// Guaranteed: `old_mem.len` is the same as what was returned from `allocFn` or `reallocFn`
|
||||
freeFn: fn (self: *Allocator, old_mem: []u8) void,
|
||||
|
||||
/// Call destroy with the result
|
||||
/// Call `destroy` with the result
|
||||
pub fn create(self: *Allocator, init: var) Error!*@typeOf(init) {
|
||||
const T = @typeOf(init);
|
||||
if (@sizeOf(T) == 0) return &{};
|
||||
@ -41,8 +41,8 @@ pub const Allocator = struct {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
/// Alias of create
|
||||
/// Call destroy with the result
|
||||
/// Alias of `create`
|
||||
/// Call `destroy` with the result
|
||||
pub fn construct(self: *Allocator, init: var) Error!*@typeOf(init) {
|
||||
return self.create(init);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user