diff options
Diffstat (limited to 'src/rt/boxed_region.cpp')
| -rw-r--r-- | src/rt/boxed_region.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rt/boxed_region.cpp b/src/rt/boxed_region.cpp index 2612d0f47b9..247424088d6 100644 --- a/src/rt/boxed_region.cpp +++ b/src/rt/boxed_region.cpp @@ -1,8 +1,7 @@ - - #include "boxed_region.h" #include "rust_globals.h" #include "rust_task.h" +#include "rust_env.h" // #define DUMP_BOXED_REGION @@ -52,8 +51,15 @@ void boxed_region::free(rust_opaque_box *box) { if (box->prev) box->prev->next = box->next; if (box->next) box->next->prev = box->prev; if (live_allocs == box) live_allocs = box->next; + + if (env->poison_on_free) { + memset(box_body(box), 0xab, box->td->size); + return; + } + box->prev = NULL; box->next = NULL; box->td = NULL; + backing_region->free(box); } |
