summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAliaksey Kandratsenka <alkondratenko@gmail.com>2015-10-04 21:27:56 -0700
committerAliaksey Kandratsenka <alkondratenko@gmail.com>2015-10-05 21:05:43 -0700
commitac301a6e6d4592c57c6cff7e6f035e063c423b7a (patch)
tree140d5892e1be7e7c28bd322503e34c47fcd8490d
parent72e6e35baf5cf133f168374bb42be36a81a26d6c (diff)
downloadgperftools-ac301a6e6d4592c57c6cff7e6f035e063c423b7a.tar.gz
speedup free code path by dropping "fast path allowed check"
-rw-r--r--src/tcmalloc.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/tcmalloc.cc b/src/tcmalloc.cc
index b7d1913..5bc400a 100644
--- a/src/tcmalloc.cc
+++ b/src/tcmalloc.cc
@@ -1302,11 +1302,10 @@ ALWAYS_INLINE void do_free_helper(void* ptr,
ALWAYS_INLINE void do_free_with_callback(void* ptr,
void (*invalid_free_fn)(void*)) {
ThreadCache* heap = NULL;
- if (LIKELY(ThreadCache::IsFastPathAllowed())) {
- heap = ThreadCache::GetCacheWhichMustBePresent();
+ heap = ThreadCache::GetCacheIfPresent();
+ if (LIKELY(heap)) {
do_free_helper(ptr, invalid_free_fn, heap, true);
} else {
- heap = ThreadCache::GetCacheIfPresent();
do_free_helper(ptr, invalid_free_fn, heap, false);
}
}