| Index: third_party/tcmalloc/chromium/src/metadata_encode_posix.h
|
| diff --git a/third_party/tcmalloc/chromium/src/static_vars.cc b/third_party/tcmalloc/chromium/src/metadata_encode_posix.h
|
| similarity index 53%
|
| copy from third_party/tcmalloc/chromium/src/static_vars.cc
|
| copy to third_party/tcmalloc/chromium/src/metadata_encode_posix.h
|
| index 2ca132e46eab49da5e2c91fa2544d282ad260a0c..919d3986e2bccf6c5c821dfa3dfc749e5c6c0b74 100644
|
| --- a/third_party/tcmalloc/chromium/src/static_vars.cc
|
| +++ b/third_party/tcmalloc/chromium/src/metadata_encode_posix.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
|
| @@ -28,41 +28,26 @@
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| // ---
|
| -// Author: Ken Ashcraft <opensource@google.com>
|
| +// Author: Rebecca Shapiro
|
| +//
|
| +// Posix metadata encryption/encoding declaration.
|
| +
|
| +#ifndef TCMALLOC_METADATA_ENCODE_POSIX_H_
|
| +#define TCMALLOC_METADATA_ENCODE_POSIX_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)];
|
| +void InitMetadataEncoder();
|
| +
|
| +uintptr_t EncodeUintptr(uintptr_t ptr);
|
| +
|
| +uintptr_t DecodeUintptr(uintptr_t 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_POSIX_H_
|
|
|