pub fn dupe(allocator: Allocator, comptime T: type, m: []const T) Error![]T
Copies m to newly allocated memory. Caller owns the memory.
m
allocator: Allocator
T: type
m: []const T
OutOfMemory
460 461 462 463 464
pub fn dupe(allocator: Allocator, comptime T: type, m: []const T) Error![]T { const new_buf = try allocator.alloc(T, m.len); @memcpy(new_buf, m); return new_buf; }
Copies
mto newly allocated memory. Caller owns the memory.