| 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..175d6e162af9deaf795d62177229ee734d74c8f1 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,12 @@ 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 (!HAS_64_BIT_POINTERS ||
|
| + size_class > FIRST_NON_0_SIZE_CLASS || s == 0)
|
| + return size_class;
|
| + return FIRST_NON_0_SIZE_CLASS;
|
| +
|
| }
|
|
|
| int NumMoveSize(size_t size);
|
|
|