-
Notifications
You must be signed in to change notification settings - Fork 294
Description
On the Allocating Memory
page it is said that the oom
langitem aborts the program by executing an "illegal cpu instruction":
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.
I've checked the code and found out that the alloc
lib actually calls std::sys::abort_internal
in rust_oom
(alloc::alloc::handle_alloc_error
→ std::alloc::rust_oom
), which resolves for example into a libc::abort
call on unix, which doesn't call any illegal instructions in my understanding but rather sends a SIGABRT
to the process.
Please correct me if I'm wrong, it might be that I've got the whole idea wrong, but I believe that phrase
. By default this just aborts the program by executing an illegal cpu instruction.
should be replaced with something like
, which aborts the program in a platform-specific manner.
Thanks!