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

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

Issue 7671034: doubly-linked free-lists for thread caches and page heaps (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: enable doubly linked lists only in Debug builds 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
« no previous file with comments | « third_party/tcmalloc/chromium/src/free_list.cc ('k') | third_party/tcmalloc/chromium/src/tcmalloc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tcmalloc/chromium/src/page_heap_allocator.h
diff --git a/third_party/tcmalloc/chromium/src/page_heap_allocator.h b/third_party/tcmalloc/chromium/src/page_heap_allocator.h
index bcff8b3cb171c99c4234d5f1cb752c23ecb4618e..e27ea045769e3d3e7024a105e17cd288d028f1a8 100644
--- a/third_party/tcmalloc/chromium/src/page_heap_allocator.h
+++ b/third_party/tcmalloc/chromium/src/page_heap_allocator.h
@@ -36,6 +36,7 @@
#include <stddef.h> // for NULL, size_t
#include "common.h" // for MetaDataAlloc
+#include "free_list.h" // for FL_Push/FL_Pop
#include "internal_logging.h" // for ASSERT, CRASH
namespace tcmalloc {
@@ -62,8 +63,7 @@ class PageHeapAllocator {
// Consult free list
void* result;
if (free_list_ != NULL) {
- result = free_list_;
- free_list_ = *(reinterpret_cast<void**>(result));
+ result = FL_Pop(&free_list_);
} else {
if (free_avail_ < sizeof(T)) {
// Need more room. We assume that MetaDataAlloc returns
@@ -85,8 +85,7 @@ class PageHeapAllocator {
}
void Delete(T* p) {
- *(reinterpret_cast<void**>(p)) = free_list_;
- free_list_ = p;
+ FL_Push(&free_list_, p);
inuse_--;
}
« no previous file with comments | « third_party/tcmalloc/chromium/src/free_list.cc ('k') | third_party/tcmalloc/chromium/src/tcmalloc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698