Does it? Rust seems happy to allocate silently all the time.
let x = String::new(“hi”);
let y = vec![];
Do either of these allocate? As the writer or reader of this code, how do I know if either of these statements result in a heap allocation, or if the data is strictly on the stack?
Zig’s requirement of explicitly passing around an Allocator type removes any ambiguity completely.
Does it? Rust seems happy to allocate silently all the time.
Do either of these allocate? As the writer or reader of this code, how do I know if either of these statements result in a heap allocation, or if the data is strictly on the stack?Zig’s requirement of explicitly passing around an Allocator type removes any ambiguity completely.