Chromium Code Reviews| Index: third_party/tcmalloc/chromium/src/common.cc |
| diff --git a/third_party/tcmalloc/chromium/src/common.cc b/third_party/tcmalloc/chromium/src/common.cc |
| index b92e988e56c0164c304f6210eb60bcc8769fcb8f..c75cd4d7bcd12fb2200b645e1c9dc5e85575d4c5 100644 |
| --- a/third_party/tcmalloc/chromium/src/common.cc |
| +++ b/third_party/tcmalloc/chromium/src/common.cc |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2008, Google Inc. |
| +// Copyright (c) 2011, Google Inc. |
| // All rights reserved. |
| // |
| // Redistribution and use in source and binary forms, with or without |
| @@ -155,6 +155,10 @@ void SizeMap::Init() { |
| } |
| next_size = max_size_in_class + kAlignment; |
| } |
| + if (IS_64_BIT_POINTERS) { |
| + class_to_size_[FIRST_USABLE_SIZE_CLASS - 1] = |
| + class_to_size_[FIRST_USABLE_SIZE_CLASS]; |
|
jar (doing other things)
2011/08/25 02:07:50
This was cute :-). I expect some tests or asserti
bxx
2011/08/25 20:23:18
Done.
|
| + } |
| // Double-check sizes just to be safe |
| for (size_t size = 0; size <= kMaxSize; size++) { |
| @@ -162,7 +166,7 @@ void SizeMap::Init() { |
| if (sc <= 0 || sc >= kNumClasses) { |
| CRASH("Bad size class %d for %" PRIuS "\n", sc, size); |
| } |
| - if (sc > 1 && size <= class_to_size_[sc-1]) { |
| + if (sc > FIRST_USABLE_SIZE_CLASS && size <= class_to_size_[sc-1]) { |
| CRASH("Allocating unnecessarily large class %d for %" PRIuS |
| "\n", sc, size); |
| } |