diff options
| author | bors <bors@rust-lang.org> | 2013-02-14 18:27:54 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-02-14 18:27:54 -0800 |
| commit | 20fd0c53edd2cc5ef5d413b8698b2c5860aa4926 (patch) | |
| tree | 6b3d2071563a7d64e8bd2bb24bc988f480cd8f08 /src/rt/rust_stack.cpp | |
| parent | af2f0ef0888d05209bddd16ab210ae0e8400b7de (diff) | |
| parent | 1a41b484bf05514f469e69efd56fcd7039d34db9 (diff) | |
| download | rust-20fd0c53edd2cc5ef5d413b8698b2c5860aa4926.tar.gz rust-20fd0c53edd2cc5ef5d413b8698b2c5860aa4926.zip | |
auto merge of #4938 : thestinger/rust/no_zero, r=brson
I removed the unused wrappers methods named `calloc` because they relied on the malloc wrapper having a `bool zero = true` default parameter (which resulted in some accidental zeroing). Perhaps wrapping the actual calloc function would be useful, but I don't know of an existing use case that could use it so I just removed these. This gives an ~1% performance improvement for TreeMap, which does a lot of small allocations. Vectors use `realloc` which didn't zero before these changes so there's no measurable change in performance.
Diffstat (limited to 'src/rt/rust_stack.cpp')
| -rw-r--r-- | src/rt/rust_stack.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rt/rust_stack.cpp b/src/rt/rust_stack.cpp index 3bcda8adf40..64ca256ff46 100644 --- a/src/rt/rust_stack.cpp +++ b/src/rt/rust_stack.cpp @@ -58,7 +58,7 @@ check_stack_canary(stk_seg *stk) { stk_seg * create_stack(memory_region *region, size_t sz) { size_t total_sz = sizeof(stk_seg) + sz; - stk_seg *stk = (stk_seg *)region->malloc(total_sz, "stack", false); + stk_seg *stk = (stk_seg *)region->malloc(total_sz, "stack"); memset(stk, 0, sizeof(stk_seg)); stk->end = (uintptr_t) &stk->data[sz]; add_stack_canary(stk); @@ -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); |
