diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-10-26 01:10:39 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-10-26 01:10:39 -0700 |
| commit | 357ef1f69cd1ffbd3c36a9e7e171b10263d94139 (patch) | |
| tree | fdbf34015e80a82799979b60454dcf9c01cafb56 /src/libstd/rt/env.rs | |
| parent | c5074ae6463876bbb9511e980fe890bebc881e41 (diff) | |
| download | rust-357ef1f69cd1ffbd3c36a9e7e171b10263d94139.tar.gz rust-357ef1f69cd1ffbd3c36a9e7e171b10263d94139.zip | |
Rewrite boxed_region/memory_region in Rust
This drops more of the old C++ runtime to rather be written in rust. A few features were lost along the way, but hopefully not too many. The main loss is that there are no longer backtraces associated with allocations (rust doesn't have a way of acquiring those just yet). Other than that though, I believe that the rest of the debugging utilities made their way over into rust. Closes #8704
Diffstat (limited to 'src/libstd/rt/env.rs')
| -rw-r--r-- | src/libstd/rt/env.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libstd/rt/env.rs b/src/libstd/rt/env.rs index c02e7fe9013..0811f7bbbdc 100644 --- a/src/libstd/rt/env.rs +++ b/src/libstd/rt/env.rs @@ -19,6 +19,7 @@ use os; static mut MIN_STACK: uint = 4000000; static mut DEBUG_BORROW: bool = false; +static mut POISON_ON_FREE: bool = false; pub fn init() { unsafe { @@ -33,6 +34,10 @@ pub fn init() { Some(_) => DEBUG_BORROW = true, None => () } + match os::getenv("RUST_POISON_ON_FREE") { + Some(_) => POISON_ON_FREE = true, + None => () + } } } @@ -43,3 +48,7 @@ pub fn min_stack() -> uint { pub fn debug_borrow() -> bool { unsafe { DEBUG_BORROW } } + +pub fn poison_on_free() -> bool { + unsafe { POISON_ON_FREE } +} |
