4 ms·
>> When we call malloc, we just hope that we have enough stack space for it, we almost never check. Does Rust or Zig's malloc allocate on stack? Those millenni
by EVa5I7bHFq9mnYK 4y ago
>> When we call malloc, we just hope that we have enough stack space for it, we almost never check.
Does Rust or Zig's malloc allocate on stack? Those millennials.
- kristoff_it 4y agoIt's a function, when you call it, it allocates a frame on the stack.
- einarr 4y agoTrue. But the author mentions malloc, it just sounds like he's using "stack" instead of "heap" by mistake.
- einarr 4y agoI see, it was a deliberate choice: https://old.reddit.com/r/Zig/comments/123jpia/blog_post_zig_and_rust/jdvj1bx/ https://old.reddit.com/r/Zig/comments/123jpia/blog_post_zig_...
- EVa5I7bHFq9mnYK 4y agoIn our times malloc always allocated on heap, not on stack. But things are different now, I guess.