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

Unified Diff: third_party/tcmalloc/chromium/src/google/malloc_extension.h

Issue 7430007: Merge tcmalloc r111 (perftools v. 1.8) with the chromium/ branch. Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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/google/malloc_extension.h
===================================================================
--- third_party/tcmalloc/chromium/src/google/malloc_extension.h (revision 94429)
+++ third_party/tcmalloc/chromium/src/google/malloc_extension.h (working copy)
@@ -81,9 +81,6 @@
// Returns NULL if failed. Otherwise, the returned pointer p up to and
// including (p + actual_size -1) have been allocated.
virtual void* Alloc(size_t size, size_t *actual_size, size_t alignment) = 0;
-
- // Notification that command-line flags have been initialized.
- virtual void FlagsInitialized() = 0;
};
// The default implementations of the following routines do nothing.
@@ -103,6 +100,7 @@
// See "verify_memory.h" to see what these routines do
virtual bool VerifyAllMemory();
+ // TODO(csilvers): change these to const void*.
virtual bool VerifyNewMemory(void* p);
virtual bool VerifyArrayNewMemory(void* p);
virtual bool VerifyMallocMemory(void* p);
@@ -283,8 +281,27 @@
// will return 0.)
// This is equivalent to malloc_size() in OS X, malloc_usable_size()
// in glibc, and _msize() for windows.
+ // TODO(csilvers): change to const void*.
virtual size_t GetAllocatedSize(void* p);
+ // Returns kOwned if this malloc implementation allocated the memory
+ // pointed to by p, or kNotOwned if some other malloc implementation
+ // allocated it or p is NULL. May also return kUnknownOwnership if
+ // the malloc implementation does not keep track of ownership.
+ // REQUIRES: p must be a value returned from a previous call to
+ // malloc(), calloc(), realloc(), memalign(), posix_memalign(),
+ // valloc(), pvalloc(), new, or new[], and must refer to memory that
+ // is currently allocated (so, for instance, you should not pass in
+ // a pointer after having called free() on it).
+ enum Ownership {
+ // NOTE: Enum values MUST be kept in sync with the version in
+ // malloc_extension_c.h
+ kUnknownOwnership = 0,
+ kOwned,
+ kNotOwned
+ };
+ virtual Ownership GetOwnership(const void* p);
+
// The current malloc implementation. Always non-NULL.
static MallocExtension* instance();

Powered by Google App Engine
This is Rietveld 408576698