summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchappedm@gmail.com <chappedm@gmail.com@6b5cf1ce-ec42-a296-1ba9-69fdba395a50>2012-12-22 19:02:52 +0000
committerchappedm@gmail.com <chappedm@gmail.com@6b5cf1ce-ec42-a296-1ba9-69fdba395a50>2012-12-22 19:02:52 +0000
commit09d97533b09e473c0cdd269e8cf4e9a9737e49fa (patch)
treedfe00dfc567d21ff03fb407405116318aa695249
parent990889e6232ff3787f1d42d4091a0478ffb93988 (diff)
downloadgperftools-09d97533b09e473c0cdd269e8cf4e9a9737e49fa.tar.gz
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
-rw-r--r--src/tcmalloc.cc4
1 files 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;