| Index: third_party/tcmalloc/chromium/src/metadata_encode_disabled.h
|
| diff --git a/third_party/tcmalloc/chromium/src/static_vars.cc b/third_party/tcmalloc/chromium/src/metadata_encode_disabled.h
|
| similarity index 53%
|
| copy from third_party/tcmalloc/chromium/src/static_vars.cc
|
| copy to third_party/tcmalloc/chromium/src/metadata_encode_disabled.h
|
| index 2ca132e46eab49da5e2c91fa2544d282ad260a0c..ca836214a6cc90b1a32aa70d9111b1869a445539 100644
|
| --- a/third_party/tcmalloc/chromium/src/static_vars.cc
|
| +++ b/third_party/tcmalloc/chromium/src/metadata_encode_disabled.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
|
| @@ -26,43 +26,26 @@
|
| // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| -
|
| // ---
|
| -// Author: Ken Ashcraft <opensource@google.com>
|
| +// Author: Rebecca Shapiro
|
| +//
|
| +// Implemenation of metadata encoding that doesn't change the value
|
| +// being encoded.
|
| +
|
| +#ifndef TCMALLOC_METADATA_ENCODE_DISABLED_H_
|
| +#define TCMALLOC_METADATA_ENCODE_DISABLED_H_
|
|
|
| -#include "static_vars.h"
|
| -#include <stddef.h> // for NULL
|
| -#include <new> // for operator new
|
| -#include "internal_logging.h" // for CHECK_CONDITION
|
| -#include "sampler.h" // for Sampler
|
| +#include "config.h"
|
| +#ifdef HAVE_STDINT_H
|
| +#include <stdint.h> // for uintptr_t
|
| +#endif
|
|
|
| namespace tcmalloc {
|
|
|
| -SpinLock Static::pageheap_lock_(SpinLock::LINKER_INITIALIZED);
|
| -SizeMap Static::sizemap_;
|
| -CentralFreeListPadded Static::central_cache_[kNumClasses];
|
| -PageHeapAllocator<Span> Static::span_allocator_;
|
| -PageHeapAllocator<StackTrace> Static::stacktrace_allocator_;
|
| -Span Static::sampled_objects_;
|
| -PageHeapAllocator<StackTraceTable::Bucket> Static::bucket_allocator_;
|
| -StackTrace* Static::growth_stacks_ = NULL;
|
| -char Static::pageheap_memory_[sizeof(PageHeap)];
|
| +inline void InitMetadataEncoder() {}
|
| +inline uintptr_t EncodeUintptr(uintptr_t ptr) { return ptr; }
|
| +inline uintptr_t DecodeUintptr(uintptr_t ptr) { return ptr; }
|
|
|
| -void Static::InitStaticVars() {
|
| - sizemap_.Init();
|
| - span_allocator_.Init();
|
| - span_allocator_.New(); // Reduce cache conflicts
|
| - span_allocator_.New(); // Reduce cache conflicts
|
| - stacktrace_allocator_.Init();
|
| - bucket_allocator_.Init();
|
| - // Do a bit of sanitizing: make sure central_cache is aligned properly
|
| - CHECK_CONDITION((sizeof(central_cache_[0]) % 64) == 0);
|
| - for (int i = 0; i < kNumClasses; ++i) {
|
| - central_cache_[i].Init(i);
|
| - }
|
| - new ((void*)pageheap_memory_) PageHeap;
|
| - DLL_Init(&sampled_objects_);
|
| - Sampler::InitStatics();
|
| }
|
|
|
| -} // namespace tcmalloc
|
| +#endif // TCMALLOC_METADATA_ENCODE_DISABLED_H_
|
|
|