3 ms·
Rust doesn't have invisible allocations. The compiler doesn't even know what an allocation is.
by paavohtl 6y ago
Rust doesn't have invisible allocations. The compiler doesn't even know what an allocation is.
- mcguire 6y ago"So if the Rust compiler causes hidden allocations that cannot be caught and returned as errors, then I seriously think that this whole approach needs to be entirely NAK'ed, and the Rust infrastructure - whether at the compiler level or in the kernel wrappers - needs more work." So Linus is worried about nothing?
- paavohtl 6y agoYes, basically. The Rust standard library has data structures and functions which require memory allocation, and _will_ panic on allocation failure. But the allocating subset of the standard library is a separate module, which is usually turned off in embedded or kernel-level code. The current prototype uses it to speed up development, but the long term plan as far as I understand is to replace it or augment the current implementation to support fallible allocation (which is being worked on anyway).