fn alloc(self: Allocator, comptime T: type, n: usize) Error![]T

Allocates an array of n items of type T and sets all the items to undefined. Depending on the Allocator implementation, it may be required to call free once the memory is no longer needed, to avoid a resource leak. If the Allocator implementation is unknown, then correct code will call free when done.

For allocating a single item, see create.

Parameters

self: Allocator,
T: type,
n: usize,