Skip to content

Use OOM lang item #14

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

Closed
fmckeogh opened this issue May 6, 2018 · 2 comments · Fixed by #15
Closed

Use OOM lang item #14

fmckeogh opened this issue May 6, 2018 · 2 comments · Fixed by #15

Comments

@fmckeogh
Copy link

fmckeogh commented May 6, 2018

rust-lang/rust#50144 was merged, and Alloc/GlobalAlloc::oom has been replaced by a language item.

alloc-cortex-m now fails to build, error language item required, but not found: 'oom'

The latest version of linked_list_allocator removes OOM functions (rust-osdev/linked-list-allocator@f0de36d).

I'm afraid I don't understand enough about the change to suggest a fix :(

@japaric
Copy link
Member

japaric commented May 12, 2018

Thanks for the report. With the new oom lang item the allocator doesn't have to define what happens on an Out Of Memory (OOM) condition. The behavior can now be specified by the application, or any other crate.

I think it's best to not define the oom lang item here and instead let the application decide how to deal with OOM.

alloc-cortex-m now fails to build

alloc-cortex-m builds just fine; it's the binary crate the one that errors if oom has not been defined.

I have updated the crate level documentation in #15 to show how to define oom.

@fmckeogh
Copy link
Author

Thanks! :D

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

Successfully merging a pull request may close this issue.

2 participants