You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently writing a filesystem application that runs on end-user devices and I would like to take advantage of io_uring. This often means that memory usage is very unpredictable and OOM conditions may happen often. In this case, I do not want to leave my filesystem in an inconsistent state because some computation (e.g. IO submissions, task spawning, and so on) panics.
Is it possible to have the compio library return errors when an out-of-memory condition happens?
@Berrysoft I have been making a prototype polyfill that deals with making std data structures OOM-friendly, as well as implementing ponyfills of custom data structures like slot maps and concurrent hash maps. My current approach (stored in the experimental branch) is to take advantage of the compiler's deterministic layout generation algorithm and regenerate mirrored structs that are source-compatible and thus ABI-compatible inside a FFI boundary (this requires suppressing -Zrandomize-layout. There are certain Rust structures that lose data integrity on OOM like BTrees and ponyfills risk API breaking changes, so I have to resort to it).
I want to ask you to help with reviewing the approach. It is currently not yet polished for now though as I have been prototyping it using a LLM, and I'm gradually reviewing and refining the output.
Activity
Berrysoft commentedon Aug 10, 2026
In short I don't think it's easy, as
allocator_apiis still a nightly feature...khanhtranngoccva commentedon Aug 18, 2026
@Berrysoft I have been making a prototype polyfill that deals with making std data structures OOM-friendly, as well as implementing ponyfills of custom data structures like slot maps and concurrent hash maps. My current approach
(stored in theis to take advantage of the compiler's deterministic layout generation algorithm and regenerate mirrored structs that are source-compatible and thus ABI-compatible inside a FFI boundary (this requires suppressingexperimentalbranch)-Zrandomize-layout. There are certain Rust structures that lose data integrity on OOM like BTrees and ponyfills risk API breaking changes, so I have to resort to it).I want to ask you to help with reviewing the approach. It is currently not yet polished for now though as I have been prototyping it using a LLM, and I'm gradually reviewing and refining the output.