Skip to content

Commit

Permalink
Merge pull request #133 from mexus/patch-1
Browse files Browse the repository at this point in the history
OOM behaviour in `vec-alloc.md`
  • Loading branch information
Gankra committed Apr 20, 2019
2 parents 02ef0fb + 5ceb425 commit 0a8c3a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vec-alloc.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ that, we'll need to use the rest of the heap APIs. These basically allow us to
talk directly to Rust's allocator (jemalloc by default).

We'll also need a way to handle out-of-memory (OOM) conditions. The standard
library calls `std::alloc::oom()`, which in turn calls the the `oom` langitem.
By default this just aborts the program by executing an illegal cpu instruction.
library calls `std::alloc::oom()`, which in turn calls the the `oom` langitem,
which aborts the program in a platform-specific manner.
The reason we abort and don't panic is because unwinding can cause allocations
to happen, and that seems like a bad thing to do when your allocator just came
back with "hey I don't have any more memory".
Expand Down

0 comments on commit 0a8c3a4

Please sign in to comment.