Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cfg no_global_oom_handling #594

Open
Clipi-12 opened this issue Dec 5, 2024 · 0 comments
Open

Use cfg no_global_oom_handling #594

Clipi-12 opened this issue Dec 5, 2024 · 0 comments

Comments

@Clipi-12
Copy link

Clipi-12 commented Dec 5, 2024

Issue

A big portion of the alloc crate uses cfg attributes to check whether global oom handling is enabled (see this example).

Right now the crate doesn't even compile when passing --cfg=no_global_oom_handling to rustc, so it would be nice if this crate also checked it.
It would also be nice if the existing API got extended to allow manually managing oom errors (for example, making a RawTable::try_insert which would call try_reserve instead of reserve, and so on with HashTable::insert_unique and the rest of the public API).

Impl

In a private fork of this repo I've easily managed to compile the crate without the std by cfg-ing crate::raw::Fallibility and every function / impl Trait that depended on it.
However, it is clear that the crate was not designed with the possibility of a global oom handler not existing, since there are no methods like try_insert or try_clone (which is itself a debate on it's own, since there is no TryClone trait in the std/core)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant