From 41aa41853c1101c5e6f1b5759b830dff22e560df Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Fri, 13 Jan 2017 18:17:54 -0800 Subject: [PATCH] Fix style nits. --- src/jemalloc_cpp.cpp | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/jemalloc_cpp.cpp b/src/jemalloc_cpp.cpp index 84d47aed..5cecfdbf 100644 --- a/src/jemalloc_cpp.cpp +++ b/src/jemalloc_cpp.cpp @@ -17,26 +17,25 @@ void *operator new(std::size_t size); void *operator new[](std::size_t size); -void *operator new(std::size_t size, const std::nothrow_t&) noexcept; -void *operator new[](std::size_t size, const std::nothrow_t&) noexcept; -void operator delete(void* ptr) noexcept; -void operator delete[](void* ptr) noexcept; -void operator delete(void* ptr, const std::nothrow_t&) noexcept; -void operator delete[](void* ptr, const std::nothrow_t&) noexcept; +void *operator new(std::size_t size, const std::nothrow_t &) noexcept; +void *operator new[](std::size_t size, const std::nothrow_t &) noexcept; +void operator delete(void *ptr) noexcept; +void operator delete[](void *ptr) noexcept; +void operator delete(void *ptr, const std::nothrow_t &) noexcept; +void operator delete[](void *ptr, const std::nothrow_t &) noexcept; #if __cpp_sized_deallocation >= 201309 /* C++14's sized-delete operators. */ -void operator delete(void* ptr, std::size_t size) noexcept; -void operator delete[](void* ptr, std::size_t size) noexcept; +void operator delete(void *ptr, std::size_t size) noexcept; +void operator delete[](void *ptr, std::size_t size) noexcept; #endif - template JEMALLOC_INLINE void * newImpl(std::size_t size) noexcept(IsNoExcept) { - void* ptr = je_malloc(size); + void *ptr = je_malloc(size); if (likely(ptr != nullptr)) return (ptr); @@ -55,7 +54,7 @@ newImpl(std::size_t size) noexcept(IsNoExcept) try { handler(); - } catch (const std::bad_alloc&) { + } catch (const std::bad_alloc &) { break; } @@ -80,36 +79,36 @@ operator new[](std::size_t size) } void * -operator new(std::size_t size, const std::nothrow_t&) noexcept +operator new(std::size_t size, const std::nothrow_t &) noexcept { return (newImpl(size)); } void * -operator new[](std::size_t size, const std::nothrow_t&) noexcept +operator new[](std::size_t size, const std::nothrow_t &) noexcept { return (newImpl(size)); } void -operator delete(void* ptr) noexcept +operator delete(void *ptr) noexcept { je_free(ptr); } void -operator delete[](void* ptr) noexcept +operator delete[](void *ptr) noexcept { je_free(ptr); } void -operator delete(void* ptr, const std::nothrow_t&) noexcept +operator delete(void *ptr, const std::nothrow_t &) noexcept { je_free(ptr); } -void operator delete[](void* ptr, const std::nothrow_t&) noexcept +void operator delete[](void *ptr, const std::nothrow_t &) noexcept { je_free(ptr); } @@ -117,12 +116,12 @@ void operator delete[](void* ptr, const std::nothrow_t&) noexcept #if __cpp_sized_deallocation >= 201309 void -operator delete(void* ptr, std::size_t size) noexcept +operator delete(void *ptr, std::size_t size) noexcept { je_sdallocx(ptr, size, /*flags=*/0); } -void operator delete[](void* ptr, std::size_t size) noexcept +void operator delete[](void *ptr, std::size_t size) noexcept { je_sdallocx(ptr, size, /*flags=*/0); }