ModularM
Modular13mo ago
4 replies
whatever

List memory preallocation

Is this the correct way to preallocate memory in Mojo?
var large_list = List[int](capacity=5)

Also with what is the memory preallocate (Null, 0,)?
What is the difference between size and capacity?
Does memory preallocation give me a performance improvment in Mojo?
Was this page helpful?