From 5ceb4253f7056a5ce828b5765aae6b9c90a32c5d Mon Sep 17 00:00:00 2001 From: Denis Date: Sun, 21 Apr 2019 01:00:43 +0300 Subject: [PATCH] Fix "illegal cpu instruction" in `vec-alloc.md` As per #132 --- src/vec-alloc.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vec-alloc.md b/src/vec-alloc.md index a6f88aa5..2889a731 100644 --- a/src/vec-alloc.md +++ b/src/vec-alloc.md @@ -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".