about summary refs log tree commit diff
path: root/src/rt/rust_task.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-05-06 17:52:52 -0700
committerbors <bors@rust-lang.org>2013-05-06 17:52:52 -0700
commit05460fcd5a9b2be5055f55965f768b0aa37119d9 (patch)
tree88e3b561606409ab312f933eee2df96a5397e643 /src/rt/rust_task.cpp
parentbd5fd6e42a904723c99383e684ddeaf02f01d972 (diff)
parent39a119074aa27234a68bcf57899c8c4e015cd478 (diff)
downloadrust-05460fcd5a9b2be5055f55965f768b0aa37119d9.tar.gz
rust-05460fcd5a9b2be5055f55965f768b0aa37119d9.zip
auto merge of #6286 : nikomatsakis/rust/issue-5910-dyna-freeze, r=nikomatsakis
This rather sprawling branch refactors the borrow checker and much of the region code, addressing a number of outstanding issues. I will close them manually after validating that there are test cases for each one, but here is a (probably partial) list:

  - #4903: Flow sensitivity
  - #3387: Moves in overloaded operators
  - #3850: Region granularity
  - #4666: Odd loaning errors
  - #6021: borrow check errors with hashmaps
  - #5910: @mut broken

cc #5047

(take 5)
Diffstat (limited to 'src/rt/rust_task.cpp')
-rw-r--r--src/rt/rust_task.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index 7e3c91f6211..23e70535768 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -42,6 +42,7 @@ rust_task::rust_task(rust_sched_loop *sched_loop, rust_task_state state,
     total_stack_sz(0),
     task_local_data(NULL),
     task_local_data_cleanup(NULL),
+    borrow_list(NULL),
     state(state),
     cond(NULL),
     cond_name("none"),
@@ -75,6 +76,16 @@ rust_task::delete_this()
     assert(ref_count == 0); // ||
     //   (ref_count == 1 && this == sched->root_task));
 
+    if (borrow_list) {
+        // NOTE should free borrow_list from within rust code!
+        // If there is a pointer in there, it is a ~[BorrowRecord] pointer,
+        // which are currently allocated with LIBC malloc/free. But this is
+        // not really the right way to do this, we should be freeing this
+        // pointer from Rust code.
+        free(borrow_list);
+        borrow_list = NULL;
+    }
+
     sched_loop->release_task(this);
 }