about summary refs log tree commit diff
path: root/src/rt/rust_kernel.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-06-30 15:02:05 -0700
committerbors <bors@rust-lang.org>2013-06-30 15:02:05 -0700
commit040ac2a93270b4420c59621521d554a078e2d451 (patch)
tree16dc8d87d4352a8e695949c906af4e5e55f2f47d /src/rt/rust_kernel.cpp
parentca835f482cebcd353db789e45f9cec72db1a24ed (diff)
parent4a29d6eb3f20c2b7a05bb9c9c2f964da606e39ca (diff)
downloadrust-040ac2a93270b4420c59621521d554a078e2d451.tar.gz
rust-040ac2a93270b4420c59621521d554a078e2d451.zip
auto merge of #7495 : thestinger/rust/exchange, r=cmr
With these changes, exchange allocator headers are never initialized, read or written to. Removing the header will now just involve updating the code in trans using an offset to only do it if the type contained is managed.

The only thing blocking removing the initialization of the last field in the header was ~fn since it uses it to store the dynamic size/types due to captures. I temporarily switched it to a `closure_exchange_alloc` lang item (it uses the same `exchange_free`) and #7496 is filed about removing that.

Since the `exchange_free` call is now inlined all over the codebase, I don't think we should have an assert for null. It doesn't currently ever happen, but it would be fine if we started generating code that did do it. The `exchange_free` function also had a comment declaring that it must not fail, but a regular assert would cause a failure. I also removed the atomic counter because valgrind can already find these leaks, and we have valgrind bots now.

Note that exchange free does not currently print an error an out-of-memory when it aborts, because our `io` code may allocate. We could probably get away with a `#[rust_stack]` call to a `stdio` function but it would be better to make a write system call.
Diffstat (limited to 'src/rt/rust_kernel.cpp')
-rw-r--r--src/rt/rust_kernel.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/rt/rust_kernel.cpp b/src/rt/rust_kernel.cpp
index c1c40222f1a..583f836c0d6 100644
--- a/src/rt/rust_kernel.cpp
+++ b/src/rt/rust_kernel.cpp
@@ -211,7 +211,6 @@ rust_kernel::run() {
     assert(osmain_driver != NULL);
     osmain_driver->start_main_loop();
     sched_reaper.join();
-    rust_check_exchange_count_on_exit();
     return rval;
 }