From 09d97533b09e473c0cdd269e8cf4e9a9737e49fa Mon Sep 17 00:00:00 2001 From: "chappedm@gmail.com" Date: Sat, 22 Dec 2012 19:02:52 +0000 Subject: [PATCH] issue-467: Fixed issue with allocation size being narrowed to 32-bit git-svn-id: http://gperftools.googlecode.com/svn/trunk@187 6b5cf1ce-ec42-a296-1ba9-69fdba395a50 --- src/tcmalloc.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tcmalloc.cc b/src/tcmalloc.cc index eea76b7..9092687 100644 --- a/src/tcmalloc.cc +++ b/src/tcmalloc.cc @@ -1248,8 +1248,8 @@ inline void* do_realloc_with_callback( // . If we need to grow, grow to max(new_size, old_size * 1.X) // . Don't shrink unless new_size < old_size * 0.Y // X and Y trade-off time for wasted space. For now we do 1.25 and 0.5. - const int lower_bound_to_grow = old_size + old_size / 4; - const int upper_bound_to_shrink = old_size / 2; + const size_t lower_bound_to_grow = old_size + old_size / 4ul; + const size_t upper_bound_to_shrink = old_size / 2ul; if ((new_size > old_size) || (new_size < upper_bound_to_shrink)) { // Need to reallocate. void* new_ptr = NULL;