| Index: third_party/tcmalloc/chromium/src/common.h
|
| diff --git a/third_party/tcmalloc/chromium/src/common.h b/third_party/tcmalloc/chromium/src/common.h
|
| index a3df8de02fd0056b750e096d0d74eb5477cde6bb..7494c9bcafab1b17224cb182d7649a195516e40f 100644
|
| --- a/third_party/tcmalloc/chromium/src/common.h
|
| +++ b/third_party/tcmalloc/chromium/src/common.h
|
| @@ -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
|
| @@ -31,7 +31,6 @@
|
| // Author: Sanjay Ghemawat <opensource@google.com>
|
| //
|
| // Common definitions for tcmalloc code.
|
| -
|
| #ifndef TCMALLOC_COMMON_H_
|
| #define TCMALLOC_COMMON_H_
|
|
|
| @@ -40,6 +39,7 @@
|
| #ifdef HAVE_STDINT_H
|
| #include <stdint.h> // for uintptr_t, uint64_t
|
| #endif
|
| +#include "free_list.h" // for SIZE_CLASS macros
|
| #include "internal_logging.h" // for ASSERT, etc
|
|
|
| // Type that can hold a page number
|
| @@ -175,7 +175,11 @@ class SizeMap {
|
| const bool big = (s > kMaxSmallSize);
|
| const int add_amount = big ? (127 + (120<<7)) : 7;
|
| const int shift_amount = big ? 7 : 3;
|
| - return (s + add_amount) >> shift_amount;
|
| + const int size_class = (s + add_amount) >> shift_amount;
|
| + if ((s == 0) || (!IS_64_BIT_POINTERS) ||
|
| + (size_class > FIRST_USABLE_SIZE_CLASS))
|
| + return size_class;
|
| + return FIRST_USABLE_SIZE_CLASS;
|
| }
|
|
|
| int NumMoveSize(size_t size);
|
|
|