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

Unified Diff: third_party/tcmalloc/chromium/src/base/low_level_alloc.cc

Issue 7050034: Merge google-perftools r109 (the current contents of third_party/tcmalloc/vendor) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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
« no previous file with comments | « third_party/tcmalloc/chromium/src/base/logging.h ('k') | third_party/tcmalloc/chromium/src/base/spinlock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tcmalloc/chromium/src/base/low_level_alloc.cc
===================================================================
--- third_party/tcmalloc/chromium/src/base/low_level_alloc.cc (revision 88335)
+++ third_party/tcmalloc/chromium/src/base/low_level_alloc.cc (working copy)
@@ -59,7 +59,9 @@
// ---------------------------------------------------------------------------
static const int kMaxLevel = 30;
-namespace {
+// We put this class-only struct in a namespace to avoid polluting the
+// global namespace with this struct name (thus risking an ODR violation).
+namespace low_level_alloc_internal {
// This struct describes one allocated block, or one free block.
struct AllocList {
struct Header {
@@ -79,7 +81,9 @@
// LLA_SkiplistLevels()
};
}
+using low_level_alloc_internal::AllocList;
+
// ---------------------------------------------------------------------------
// A trivial skiplist implementation. This is used to keep the freelist
// in address order while taking only logarithmic time per insert and delete.
@@ -208,7 +212,7 @@
static const intptr_t kMagicUnallocated = ~kMagicAllocated;
namespace {
- class ArenaLock {
+ class SCOPED_LOCKABLE ArenaLock {
public:
explicit ArenaLock(LowLevelAlloc::Arena *arena)
EXCLUSIVE_LOCK_FUNCTION(arena->mu)
@@ -229,7 +233,7 @@
this->arena_->mu.Lock();
}
~ArenaLock() { RAW_CHECK(this->left_, "haven't left Arena region"); }
- void Leave() UNLOCK_FUNCTION(arena_->mu) {
+ void Leave() UNLOCK_FUNCTION() {
this->arena_->mu.Unlock();
#if 0
if (this->mask_valid_) {
« no previous file with comments | « third_party/tcmalloc/chromium/src/base/logging.h ('k') | third_party/tcmalloc/chromium/src/base/spinlock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698