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

Fallible allocation? #25

Open
kornelski opened this issue Oct 4, 2021 · 1 comment
Open

Fallible allocation? #25

kornelski opened this issue Oct 4, 2021 · 1 comment

Comments

@kornelski
Copy link

from_header_and_iter calls alloc::handle_alloc_error, which unfortunately is an unconditional process-killing abort.

I have a situation where real OOM really happens, and I really need to handle it gracefully.

Could you replace the call to handle_alloc_error with a regular panic!("oom"), at least as an option? A try_ version of the method would be fine too.

@Manishearth
Copy link
Owner

I would be open for a PR adding a try version that returns the layout as an error type

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

2 participants