summaryrefslogtreecommitdiff
path: root/src/jemalloc_cpp.cpp
diff options
context:
space:
mode:
authormgrice <mgrice@fb.com>2019-03-08 11:50:30 -0800
committerQi Wang <interwq@gmail.com>2019-04-08 10:59:05 -0700
commitd3d7a8ef09b6fa79109e8930aaba7a677f8b24ac (patch)
tree33aeb53a9e962c9092a7f9d1b8365ca26e5ebfad /src/jemalloc_cpp.cpp
parentc2a3a7cd3f3cbc177d677101be85a31a39c26bd0 (diff)
remove compare and branch in fast path for c++ operator delete[]
Summary: sdallocx is checking a flag that will never be set (at least in the provided C++ destructor implementation). This branch will probably only rarely be mispredicted however it removes two instructions in sdallocx and one at the callsite (to zero out flags).
Diffstat (limited to 'src/jemalloc_cpp.cpp')
-rw-r--r--src/jemalloc_cpp.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/jemalloc_cpp.cpp b/src/jemalloc_cpp.cpp
index f0ceddae..da0441a7 100644
--- a/src/jemalloc_cpp.cpp
+++ b/src/jemalloc_cpp.cpp
@@ -128,14 +128,14 @@ operator delete(void *ptr, std::size_t size) noexcept {
if (unlikely(ptr == nullptr)) {
return;
}
- je_sdallocx(ptr, size, /*flags=*/0);
+ je_sdallocx_noflags(ptr, size);
}
void operator delete[](void *ptr, std::size_t size) noexcept {
if (unlikely(ptr == nullptr)) {
return;
}
- je_sdallocx(ptr, size, /*flags=*/0);
+ je_sdallocx_noflags(ptr, size);
}
#endif // __cpp_sized_deallocation