Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Unified Diff: third_party/tcmalloc/chromium/src/metadata_encode_disabled.h

Issue 7833003: code for encrypting sensitive tcmalloc metadata (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: fixed bug of key_ existing as multiple copies Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_
« no previous file with comments | « third_party/tcmalloc/chromium/src/metadata_encode.h ('k') | third_party/tcmalloc/chromium/src/metadata_encode_posix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698