Index: third_party/tcmalloc/chromium/src/thread_cache.cc |
diff --git a/third_party/tcmalloc/chromium/src/thread_cache.cc b/third_party/tcmalloc/chromium/src/thread_cache.cc |
index d6dead39c2f58e44d6f0bddac8ed373a102d4f6e..07b43e62ecfead61a9e2c524f402fcb3383d56ad 100644 |
--- a/third_party/tcmalloc/chromium/src/thread_cache.cc |
+++ b/third_party/tcmalloc/chromium/src/thread_cache.cc |
@@ -164,7 +164,10 @@ void* ThreadCache::FetchFromCentralCache(size_t cl, size_t byte_size) { |
ASSERT((start == NULL) == (fetch_count == 0)); |
if (--fetch_count >= 0) { |
size_ += byte_size * fetch_count; |
- list->PushRange(fetch_count, SLL_Next(start), end); |
+ // Pop the top of the list and add the rest to the freelist. |
+ void *second = start; |
+ start = FL_Pop(&second); |
+ list->PushRange(fetch_count, second, end); |
} |
// Increase max length slowly up to batch_size. After that, |