From 7103ca95ac8e92fd32ab65321cd443a7233a48e0 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Thu, 14 Feb 2013 16:04:30 -0500 Subject: rm unused zero param in C++ exchange allocator --- src/rt/rust_exchange_alloc.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/rt/rust_exchange_alloc.cpp') 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); -- cgit 1.4.1-3-g733a5 From 2e0614750c398c9aac2f4064addb2fa95ba32282 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Thu, 14 Feb 2013 18:13:25 -0500 Subject: get rid of unused exchange_alloc calloc method this isn't actually calloc - it calls the malloc wrapper which no longer zeroes --- src/rt/rust_exchange_alloc.cpp | 5 ----- src/rt/rust_exchange_alloc.h | 1 - src/rt/rust_kernel.cpp | 5 ----- src/rt/rust_kernel.h | 1 - 4 files changed, 12 deletions(-) (limited to 'src/rt/rust_exchange_alloc.cpp') diff --git a/src/rt/rust_exchange_alloc.cpp b/src/rt/rust_exchange_alloc.cpp index eda3dbee831..a92bc4edd41 100644 --- a/src/rt/rust_exchange_alloc.cpp +++ b/src/rt/rust_exchange_alloc.cpp @@ -27,11 +27,6 @@ rust_exchange_alloc::malloc(size_t size) { return value; } -void * -rust_exchange_alloc::calloc(size_t size) { - return this->malloc(size); -} - void * rust_exchange_alloc::realloc(void *ptr, size_t size) { void *new_ptr = ::realloc(ptr, size); diff --git a/src/rt/rust_exchange_alloc.h b/src/rt/rust_exchange_alloc.h index d904d345666..767caf01323 100644 --- a/src/rt/rust_exchange_alloc.h +++ b/src/rt/rust_exchange_alloc.h @@ -17,7 +17,6 @@ class rust_exchange_alloc { public: 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_kernel.cpp b/src/rt/rust_kernel.cpp index e0494c9300b..75d70396aac 100644 --- a/src/rt/rust_kernel.cpp +++ b/src/rt/rust_kernel.cpp @@ -79,11 +79,6 @@ rust_kernel::malloc(size_t size, const char *tag) { return exchange_alloc.malloc(size); } -void * -rust_kernel::calloc(size_t size, const char *tag) { - return exchange_alloc.calloc(size); -} - void * rust_kernel::realloc(void *mem, size_t size) { return exchange_alloc.realloc(mem, size); diff --git a/src/rt/rust_kernel.h b/src/rt/rust_kernel.h index 11af02dace4..d814e49c808 100644 --- a/src/rt/rust_kernel.h +++ b/src/rt/rust_kernel.h @@ -133,7 +133,6 @@ public: void fatal(char const *fmt, ...); void *malloc(size_t size, const char *tag); - void *calloc(size_t size, const char *tag); void *realloc(void *mem, size_t size); void free(void *mem); rust_exchange_alloc *region() { return &exchange_alloc; } -- cgit 1.4.1-3-g733a5