rm unused zero param in C++ exchange allocator

This commit is contained in:
Daniel Micay 2013-02-14 16:04:30 -05:00
parent 22e88d510f
commit 7103ca95ac
3 changed files with 3 additions and 6 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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);