about summary refs log tree commit diff
path: root/src/rt/rust_exchange_alloc.cpp
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2013-05-17 17:53:50 -0700
committerBrian Anderson <banderson@mozilla.com>2013-05-17 17:53:50 -0700
commit03a8e59615f7ced4def8adaad41cfcb0fd0f9d29 (patch)
tree560956d27a7945a464d8d8ec742be4ea5fbecb69 /src/rt/rust_exchange_alloc.cpp
parent2d28d645422c1617be58c8ca7ad9a457264ca850 (diff)
parent018dfaf9a6a25f5dba0ac642ff6c426c549bc4d7 (diff)
downloadrust-03a8e59615f7ced4def8adaad41cfcb0fd0f9d29.tar.gz
rust-03a8e59615f7ced4def8adaad41cfcb0fd0f9d29.zip
Merge remote-tracking branch 'brson/io' into incoming
Diffstat (limited to 'src/rt/rust_exchange_alloc.cpp')
-rw-r--r--src/rt/rust_exchange_alloc.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/rt/rust_exchange_alloc.cpp b/src/rt/rust_exchange_alloc.cpp
index 5958c68f3e7..89257dc9f6e 100644
--- a/src/rt/rust_exchange_alloc.cpp
+++ b/src/rt/rust_exchange_alloc.cpp
@@ -15,14 +15,15 @@
 #include <string.h>
 #include <stdio.h>
 
-uintptr_t exchange_count = 0;
+extern uintptr_t rust_exchange_count;
+uintptr_t rust_exchange_count = 0;
 
 void *
 rust_exchange_alloc::malloc(size_t size) {
   void *value = ::malloc(size);
   assert(value);
 
-  sync::increment(exchange_count);
+  sync::increment(rust_exchange_count);
 
   return value;
 }
@@ -36,20 +37,15 @@ rust_exchange_alloc::realloc(void *ptr, size_t size) {
 
 void
 rust_exchange_alloc::free(void *ptr) {
-  sync::decrement(exchange_count);
+  sync::decrement(rust_exchange_count);
   ::free(ptr);
 }
 
-extern "C" uintptr_t *
-rust_get_exchange_count_ptr() {
-  return &exchange_count;
-}
-
 void
 rust_check_exchange_count_on_exit() {
-  if (exchange_count != 0) {
+  if (rust_exchange_count != 0) {
     printf("exchange heap not empty on exit\n");
-    printf("%d dangling allocations\n", (int)exchange_count);
+    printf("%d dangling allocations\n", (int)rust_exchange_count);
     abort();
   }
 }