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

Unified Diff: third_party/tcmalloc/chromium/src/base/stl_allocator.h

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, 7 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/base/stl_allocator.h
===================================================================
--- third_party/tcmalloc/chromium/src/base/stl_allocator.h (revision 87277)
+++ third_party/tcmalloc/chromium/src/base/stl_allocator.h (working copy)
@@ -37,15 +37,15 @@
#include <config.h>
+#include <stddef.h> // for ptrdiff_t
#include <limits>
-#include "base/basictypes.h"
#include "base/logging.h"
// Generic allocator class for STL objects
// that uses a given type-less allocator Alloc, which must provide:
// static void* Alloc::Allocate(size_t size);
-// static void Alloc::Free(void* ptr);
+// static void Alloc::Free(void* ptr, size_t size);
//
// STL_Allocator<T, MyAlloc> provides the same thread-safety
// guarantees as MyAlloc.
@@ -82,7 +82,7 @@
RAW_DCHECK((n * sizeof(T)) / sizeof(T) == n, "n is too big to allocate");
return static_cast<T*>(Alloc::Allocate(n * sizeof(T)));
}
- void deallocate(pointer p, size_type /*n*/) { Alloc::Free(p); }
+ void deallocate(pointer p, size_type n) { Alloc::Free(p, n * sizeof(T)); }
size_type max_size() const { return size_t(-1) / sizeof(T); }

Powered by Google App Engine
This is Rietveld 408576698