diff --git a/src/lib/test.rs b/src/lib/test.rs index 37fec12e9ce..cbee1f1f479 100644 --- a/src/lib/test.rs +++ b/src/lib/test.rs @@ -26,7 +26,6 @@ export configure_test_task; export joinable; native "rust" mod rustrt { - fn hack_allow_leaks(); fn sched_threads() -> uint; } @@ -325,12 +324,6 @@ fn configure_test_task() { // If this task fails we don't want that failure to propagate to the // test runner or else we couldn't keep running tests task::unsupervise(); - - // FIXME (236): Hack supreme - unwinding doesn't work yet so if this - // task fails memory will not be freed correctly. This turns off the - // sanity checks in the runtime's memory region for the task, so that - // the test runner can continue. - rustrt::hack_allow_leaks(); } // Local Variables: diff --git a/src/rt/memory_region.cpp b/src/rt/memory_region.cpp index ef8a92b427f..a55d073543d 100644 --- a/src/rt/memory_region.cpp +++ b/src/rt/memory_region.cpp @@ -15,13 +15,13 @@ memory_region::alloc_header *memory_region::get_header(void *mem) { memory_region::memory_region(rust_srv *srv, bool synchronized) : _srv(srv), _parent(NULL), _live_allocations(0), _detailed_leaks(srv->env->detailed_leaks), - _synchronized(synchronized), _hack_allow_leaks(false) { + _synchronized(synchronized) { } memory_region::memory_region(memory_region *parent) : _srv(parent->_srv), _parent(parent), _live_allocations(0), _detailed_leaks(parent->_detailed_leaks), - _synchronized(parent->_synchronized), _hack_allow_leaks(false) { + _synchronized(parent->_synchronized) { } void memory_region::add_alloc() { @@ -127,18 +127,13 @@ memory_region::~memory_region() { assert(leak_count == _live_allocations); } #endif - if (!_hack_allow_leaks && _live_allocations > 0) { + if (_live_allocations > 0) { _srv->fatal(msg, __FILE__, __LINE__, "%d objects", _live_allocations); } if (_synchronized) { _lock.unlock(); } } -void -memory_region::hack_allow_leaks() { - _hack_allow_leaks = true; -} - void memory_region::release_alloc(void *mem) { alloc_header *alloc = get_header(mem); diff --git a/src/rt/memory_region.h b/src/rt/memory_region.h index 0197057268c..9d2106c1eaf 100644 --- a/src/rt/memory_region.h +++ b/src/rt/memory_region.h @@ -32,7 +32,6 @@ private: const bool _detailed_leaks; const bool _synchronized; lock_and_signal _lock; - bool _hack_allow_leaks; void add_alloc(); void dec_alloc(); @@ -46,10 +45,6 @@ public: void *realloc(void *mem, size_t size); void free(void *mem); virtual ~memory_region(); - // FIXME (236: This is a temporary hack to allow failing tasks that leak - // to not kill the entire process, which the test runner needs. Please - // kill with prejudice once unwinding works. - void hack_allow_leaks(); void release_alloc(void *mem); void claim_alloc(void *mem); diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 5e0c9dbf4c2..2499dea0328 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -224,13 +224,6 @@ debug_opaque(rust_task *task, type_desc *t, uint8_t *front) } } -extern "C" CDECL void -hack_allow_leaks(rust_task *task) -{ - LOG(task, stdlib, "hack_allow_leaks"); - task->local_region.hack_allow_leaks(); -} - struct rust_box { RUST_REFCOUNTED(rust_box) diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in index 246ac261f8f..bf8155b7998 100644 --- a/src/rt/rustrt.def.in +++ b/src/rt/rustrt.def.in @@ -28,7 +28,6 @@ get_task_id get_task_pointer get_task_trampoline get_time -hack_allow_leaks last_os_error leak migrate_alloc