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
This commit is contained in:
parent
990889e623
commit
09d97533b0
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue