diff options
-rw-r--r-- | src/tcmalloc.cc | 5 |
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); } } |