diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2013-02-14 18:28:04 -0500 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2013-02-14 18:28:04 -0500 |
| commit | 1a41b484bf05514f469e69efd56fcd7039d34db9 (patch) | |
| tree | 7919895f900eeab44123a9bac38b38bdcb591d3a /src/rt/memory_region.cpp | |
| parent | 2e0614750c398c9aac2f4064addb2fa95ba32282 (diff) | |
| download | rust-1a41b484bf05514f469e69efd56fcd7039d34db9.tar.gz rust-1a41b484bf05514f469e69efd56fcd7039d34db9.zip | |
rm the unused calloc wrapper from memory_region
it doesn't actually call calloc, so it's fairly pointless
Diffstat (limited to 'src/rt/memory_region.cpp')
| -rw-r--r-- | src/rt/memory_region.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/rt/memory_region.cpp b/src/rt/memory_region.cpp index 6307730b0f4..6de9d5a1df4 100644 --- a/src/rt/memory_region.cpp +++ b/src/rt/memory_region.cpp @@ -121,8 +121,10 @@ memory_region::realloc(void *mem, size_t orig_size) { } void * -memory_region::malloc(size_t size, const char *tag, bool zero) { +memory_region::malloc(size_t size, const char *tag) { +# if RUSTRT_TRACK_ALLOCATIONS >= 1 size_t old_size = size; +# endif size += HEADER_SIZE; alloc_header *mem = (alloc_header *)::malloc(size); if (mem == NULL) { @@ -143,18 +145,9 @@ memory_region::malloc(size_t size, const char *tag, bool zero) { void *data = get_data(mem); claim_alloc(data); - if(zero) { - memset(data, 0, old_size); - } - return data; } -void * -memory_region::calloc(size_t size, const char *tag) { - return malloc(size, tag, true); -} - memory_region::~memory_region() { if (_synchronized) { _lock.lock(); } if (_live_allocations == 0 && !_detailed_leaks) { |
