Linus Torvalds on memory allocation and Rust

I think this is hugely relevant to Zig. It’s as if Andrew Kelley had a crystal ball!

And if the panic situation is some fundamental “this is what the Rust
compiler does for internal allocation failures”, then I think it needs
more than just kernel wrapper work - it needs the Rust compiler to be


1 Like

Indeed. But I think that the tide is sufficiently leaning on this direction that a solution can be found which will satisfy Torvalds.

However, I do think that for low level code Zig went in a slightly better direction on this issue. If it were (hypothetically) Zig, and not Rust, being discussed then the solution would be simple: Define an allocator that cannot panic and enforce it’s usage in all kernel code :slight_smile: