Bulletproof load from memory
You don't know whether a memory location is valid? Don't worry, Here's the bulletproof load!
Usage
Add this to your Cargo.toml
:
[]
= "0.1"
Next, use bulletproof loader as follows:
extern crate bulletproof;
How?
Internally, Loader::new()
installs a signal handler for segmentation fault (SIGSEGV
), which
recovers from the fault using longjmp()
.
Why?
You PROBABLY should not use this library: instead of relying on bulletproof load, remove your
segmentation faults! However, if you want to build low-level systems such as virtual machine or
garbage collectors, bulletproof load can be a versatile tool for an additional bit of
efficiency. For example, see the ThreadCrashProtection
class in Java HotSpot virtual machine:
http://hg.openjdk.java.net/jdk10/jdk10/hotspot/file/tip/src/os/posix/vm/os_posix.hpp#l115
License
Licensed under the terms of MIT license and the Apache License (Version 2.0).
See LICENSE-MIT and LICENSE-APACHE for details.