summary refs log tree commit diff
path: root/src/rt
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-09-08 16:59:23 -0700
committerBrian Anderson <banderson@mozilla.com>2011-09-11 17:31:40 -0700
commit22001d1dcef5d2c40a242402f75d5acc540bee2b (patch)
treea55206e06b4cc3dabebb699d295c9b83704c0b94 /src/rt
parentd267e7486e7158f8633424389f789d23149e1064 (diff)
downloadrust-22001d1dcef5d2c40a242402f75d5acc540bee2b.tar.gz
rust-22001d1dcef5d2c40a242402f75d5acc540bee2b.zip
Remove hack_allow_leaks
Happy to close the loop on this one.

Issue #236
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/memory_region.cpp11
-rw-r--r--src/rt/memory_region.h5
-rw-r--r--src/rt/rust_builtin.cpp7
-rw-r--r--src/rt/rustrt.def.in1
4 files changed, 3 insertions, 21 deletions
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,7 +127,7 @@ 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);
     }
@@ -135,11 +135,6 @@ memory_region::~memory_region() {
 }
 
 void
-memory_region::hack_allow_leaks() {
-    _hack_allow_leaks = true;
-}
-
-void
 memory_region::release_alloc(void *mem) {
     alloc_header *alloc = get_header(mem);
     assert(alloc->magic == MAGIC);
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