18 ms·
My understanding isn't that you _can't_, but that you _aren't allowed to_ by kernel policy. (The risk being that the kernel will panic on OOM, which is not an
by mcronce 4y ago
My understanding isn't that you _can't_, but that you _aren't allowed to_ by kernel policy. (The risk being that the kernel will panic on OOM, which is not an acceptable way for the kernel to deal with OOM conditions.)
If this is out of tree, AFAIK you can use these all you want. Whether or not you _should_ is obviously a different matter.
- tialaramex 4y agoNo, you can't - they don't exist in Rust for Linux. In Rust the alloc library's Vec has a function Vec::push(&mut self, value: T) https://doc.rust-lang.org/std/vec/struct.Vec.html#method.push https://doc.rust-lang.org/std/vec/struct.Vec.html#method.pus... In Rust for Linux their custom alloc library does not have that function offering instead Vec::try_push(&mut self, value: T) -> Result<(), TryReserveError> https://rust-for-linux.github.io/docs/alloc/vec/struct.Vec.html#method.try_push https://rust-for-linux.github.io/docs/alloc/vec/struct.Vec.h...
- kaba0 4y agoWhat’s up with the Allocator API? Then it could be Vec::push<Allocator>(..), giving it an always-failing one for example.
- tialaramex 4y agoVec::push<Allocator>(..) makes no sense, the Allocator is a parameter to the Vec type.
- kaba0 4y agoThat’s what I meant to write
- tialaramex 4y agoOK and... ? What purpose does an always-failing allocator for Vec have? I guess maybe it's useful for some unit testing cases, but otherwise it seems pointless.