 Chromium Code Reviews
 Chromium Code Reviews Issue 7671034:
  doubly-linked free-lists for thread caches and page heaps  (Closed) 
  Base URL: http://git.chromium.org/git/chromium.git@trunk
    
  
    Issue 7671034:
  doubly-linked free-lists for thread caches and page heaps  (Closed) 
  Base URL: http://git.chromium.org/git/chromium.git@trunk| Index: third_party/tcmalloc/chromium/src/thread_cache.h | 
| diff --git a/third_party/tcmalloc/chromium/src/thread_cache.h b/third_party/tcmalloc/chromium/src/thread_cache.h | 
| index 1742d5ba54e57fad4fea8e1612f7ce4a83be29f9..31fbee82a5bacadb4c964690f2a6b6ed26f80da0 100644 | 
| --- a/third_party/tcmalloc/chromium/src/thread_cache.h | 
| +++ b/third_party/tcmalloc/chromium/src/thread_cache.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 | 
| @@ -42,16 +42,10 @@ | 
| #include <stdint.h> // for uint32_t, uint64_t | 
| #endif | 
| #include <sys/types.h> // for ssize_t | 
| -#include "common.h" | 
| -#include "linked_list.h" | 
| -#include "maybe_threads.h" | 
| -#include "page_heap_allocator.h" | 
| -#include "sampler.h" | 
| -#include "static_vars.h" | 
| - | 
| #include "common.h" // for SizeMap, kMaxSize, etc | 
| 
jar (doing other things)
2011/08/20 02:40:30
minimalist: don't reorder includes.
 
bxx
2011/08/24 00:19:24
I was removing duplicates of includes:
common.h, p
 | 
| +#include "free_list.h" // for FL_Pop, FL_PopRange, etc | 
| #include "internal_logging.h" // for ASSERT, etc | 
| 
jar (doing other things)
2011/08/20 02:40:30
again... don't reorder.
 
bxx
2011/08/24 00:19:24
Ditto with the duplicated includes.
On 2011/08/20
 | 
| -#include "linked_list.h" // for SLL_Pop, SLL_PopRange, etc | 
| +#include "maybe_threads.h" | 
| #include "page_heap_allocator.h" // for PageHeapAllocator | 
| #include "sampler.h" // for Sampler | 
| #include "static_vars.h" // for Static | 
| @@ -198,7 +192,7 @@ class ThreadCache { | 
| void clear_lowwatermark() { lowater_ = length_; } | 
| void Push(void* ptr) { | 
| - SLL_Push(&list_, ptr); | 
| + FL_Push(&list_, ptr); | 
| length_++; | 
| } | 
| @@ -206,16 +200,17 @@ class ThreadCache { | 
| ASSERT(list_ != NULL); | 
| length_--; | 
| if (length_ < lowater_) lowater_ = length_; | 
| - return SLL_Pop(&list_); | 
| + return FL_Pop(&list_); | 
| } | 
| + | 
| 
jar (doing other things)
2011/08/20 02:40:30
delete extra line.
 
bxx
2011/08/24 00:19:24
Done.
 | 
| void PushRange(int N, void *start, void *end) { | 
| - SLL_PushRange(&list_, start, end); | 
| + FL_PushRange(&list_, start, end); | 
| length_ += N; | 
| } | 
| void PopRange(int N, void **start, void **end) { | 
| - SLL_PopRange(&list_, N, start, end); | 
| + FL_PopRange(&list_, N, start, end); | 
| ASSERT(length_ >= N); | 
| length_ -= N; | 
| if (length_ < lowater_) lowater_ = length_; |