Re:The Linux kernel's inability to gracefully handle low mem...
by abjKT26nO8 on Tuesday August 06, 2019 @07:04AM
(#20624065)
I've just checked and it appears that c++'s std::vector::resize may throw std::bad_alloc when malloc fails, but rust's Vec::resize's interface doesn't leave any room to report any errors, so I guess that it will panic...? That's sad.
[ Parent
| on HN ]
Re:The Linux kernel's inability to gracefully handle low mem...
by steveklabnik on Tuesday August 06, 2019 @08:47AM
(#20624612)
The standard library assumes infallible allocation, yeah. We have plans to add fallible stuff eventually, but we’re still working on our allocator APIs.
Re:The Linux kernel's inability to gracefully handle low mem...
by hurrrrrrrr on Tuesday August 06, 2019 @09:29AM
(#20624938)
Rust in general will panic on memory allocation failure. There was some discussion about oom handling a while back but I don't know the current state.