diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-03-02 20:04:22 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-03-02 20:13:52 -0800 |
| commit | 38b2b74413da1d982df82fbb9552373b7dc52e69 (patch) | |
| tree | 3fef2d071778e6ca4c2e616ecea4e519f44fa5fd /src/rt/memory_region.cpp | |
| parent | 6b0c4822c10d1e0824043f81fc9e39096cc40172 (diff) | |
| download | rust-38b2b74413da1d982df82fbb9552373b7dc52e69.tar.gz rust-38b2b74413da1d982df82fbb9552373b7dc52e69.zip | |
rt: Move RUST_POISON_ON_FREE into rust_env
Diffstat (limited to 'src/rt/memory_region.cpp')
| -rw-r--r-- | src/rt/memory_region.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/rt/memory_region.cpp b/src/rt/memory_region.cpp index 29099fb14f2..e4130e80f5a 100644 --- a/src/rt/memory_region.cpp +++ b/src/rt/memory_region.cpp @@ -204,14 +204,8 @@ memory_region::claim_alloc(void *mem) { void memory_region::maybe_poison(void *mem) { - // TODO: We should lock this, in case the compiler doesn't. - static int poison = -1; - if (poison < 0) { - char *env_str = getenv("RUST_POISON_ON_FREE"); - poison = env_str != NULL && env_str[0] != '\0'; - } - if (!poison) + if (!_srv->env->poison_on_free) return; # if RUSTRT_TRACK_ALLOCATIONS >= 1 |
