about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2013-02-14 16:04:30 -0500
committerDaniel Micay <danielmicay@gmail.com>2013-02-14 16:04:30 -0500
commit7103ca95ac8e92fd32ab65321cd443a7233a48e0 (patch)
treeb051e56ad272a5a159b4d0fd2726f31e7344ff68
parent22e88d510f09a29a6799c4522d6c6ae83c324a64 (diff)
downloadrust-7103ca95ac8e92fd32ab65321cd443a7233a48e0.tar.gz
rust-7103ca95ac8e92fd32ab65321cd443a7233a48e0.zip
rm unused zero param in C++ exchange allocator
-rw-r--r--src/rt/rust_exchange_alloc.cpp5
-rw-r--r--src/rt/rust_exchange_alloc.h2
-rw-r--r--src/rt/rust_stack.cpp2
3 files changed, 3 insertions, 6 deletions
diff --git a/src/rt/rust_exchange_alloc.cpp b/src/rt/rust_exchange_alloc.cpp
index 6c0204ca736..eda3dbee831 100644
--- a/src/rt/rust_exchange_alloc.cpp
+++ b/src/rt/rust_exchange_alloc.cpp
@@ -18,12 +18,9 @@
 uintptr_t exchange_count = 0;
 
 void *
-rust_exchange_alloc::malloc(size_t size, bool zero) {
+rust_exchange_alloc::malloc(size_t size) {
   void *value = ::malloc(size);
   assert(value);
-  if (zero) {
-    memset(value, 0, size);
-  }
 
   sync::increment(exchange_count);
 
diff --git a/src/rt/rust_exchange_alloc.h b/src/rt/rust_exchange_alloc.h
index 1b52929acf1..d904d345666 100644
--- a/src/rt/rust_exchange_alloc.h
+++ b/src/rt/rust_exchange_alloc.h
@@ -16,7 +16,7 @@
 
 class rust_exchange_alloc {
  public:
-    void *malloc(size_t size, bool zero = true);
+    void *malloc(size_t size);
     void *calloc(size_t size);
     void *realloc(void *mem, size_t size);
     void free(void *mem);
diff --git a/src/rt/rust_stack.cpp b/src/rt/rust_stack.cpp
index 3bcda8adf40..7a3d21989ee 100644
--- a/src/rt/rust_stack.cpp
+++ b/src/rt/rust_stack.cpp
@@ -75,7 +75,7 @@ destroy_stack(memory_region *region, stk_seg *stk) {
 stk_seg *
 create_exchange_stack(rust_exchange_alloc *exchange, size_t sz) {
     size_t total_sz = sizeof(stk_seg) + sz;
-    stk_seg *stk = (stk_seg *)exchange->malloc(total_sz, false);
+    stk_seg *stk = (stk_seg *)exchange->malloc(total_sz);
     memset(stk, 0, sizeof(stk_seg));
     stk->end = (uintptr_t) &stk->data[sz];
     add_stack_canary(stk);