[libcxx-commits] [libcxx] f362be5 - [libc++][NFC] Reformat new.cpp and stdlib_new_delete.cpp

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 18 11:23:39 PDT 2023


Author: Louis Dionne
Date: 2023-10-18T11:23:32-07:00
New Revision: f362be597ae2561a01dd1e5050a75c00424de149

URL: https://github.com/llvm/llvm-project/commit/f362be597ae2561a01dd1e5050a75c00424de149
DIFF: https://github.com/llvm/llvm-project/commit/f362be597ae2561a01dd1e5050a75c00424de149.diff

LOG: [libc++][NFC] Reformat new.cpp and stdlib_new_delete.cpp

This makes it a lot easier to make wide ranging changes like I am
about to do in https://llvm.org/D150610.

Added: 
    

Modified: 
    libcxx/src/new.cpp
    libcxx/utils/data/ignore_format.txt
    libcxxabi/src/stdlib_new_delete.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/src/new.cpp b/libcxx/src/new.cpp
index c435c5ffc809c61..a1c9be6107bee62 100644
--- a/libcxx/src/new.cpp
+++ b/libcxx/src/new.cpp
@@ -20,239 +20,149 @@
 // in this shared library, so that they can be overridden by programs
 // that define non-weak copies of the functions.
 
-_LIBCPP_WEAK
-void *
-operator new(std::size_t size) _THROW_BAD_ALLOC
-{
-    if (size == 0)
-        size = 1;
-    void* p;
-    while ((p = std::malloc(size)) == nullptr)
-    {
-        // If malloc fails and there is a new_handler,
-        // call it to try free up memory.
-        std::new_handler nh = std::get_new_handler();
-        if (nh)
-            nh();
-        else
-#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-            throw std::bad_alloc();
-#else
-            break;
-#endif
+_LIBCPP_WEAK void* operator new(std::size_t size) _THROW_BAD_ALLOC {
+  if (size == 0)
+    size = 1;
+  void* p;
+  while ((p = std::malloc(size)) == nullptr) {
+    // If malloc fails and there is a new_handler,
+    // call it to try free up memory.
+    std::new_handler nh = std::get_new_handler();
+    if (nh)
+      nh();
+    else
+#  ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+      throw std::bad_alloc();
+#  else
+      break;
+#  endif
+  }
+  return p;
+}
+
+_LIBCPP_WEAK void* operator new(size_t size, const std::nothrow_t&) noexcept {
+  void* p = nullptr;
+#  ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+  try {
+#  endif // _LIBCPP_HAS_NO_EXCEPTIONS
+    p = ::operator new(size);
+#  ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+  } catch (...) {
+  }
+#  endif // _LIBCPP_HAS_NO_EXCEPTIONS
+  return p;
+}
+
+_LIBCPP_WEAK void* operator new[](size_t size) _THROW_BAD_ALLOC { return ::operator new(size); }
+
+_LIBCPP_WEAK void* operator new[](size_t size, const std::nothrow_t&) noexcept {
+  void* p = nullptr;
+#  ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+  try {
+#  endif // _LIBCPP_HAS_NO_EXCEPTIONS
+    p = ::operator new[](size);
+#  ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+  } catch (...) {
+  }
+#  endif // _LIBCPP_HAS_NO_EXCEPTIONS
+  return p;
+}
+
+_LIBCPP_WEAK void operator delete(void* ptr) noexcept { std::free(ptr); }
+
+_LIBCPP_WEAK void operator delete(void* ptr, const std::nothrow_t&) noexcept { ::operator delete(ptr); }
+
+_LIBCPP_WEAK void operator delete(void* ptr, size_t) noexcept { ::operator delete(ptr); }
+
+_LIBCPP_WEAK void operator delete[](void* ptr) noexcept { ::operator delete(ptr); }
+
+_LIBCPP_WEAK void operator delete[](void* ptr, const std::nothrow_t&) noexcept { ::operator delete[](ptr); }
+
+_LIBCPP_WEAK void operator delete[](void* ptr, size_t) noexcept { ::operator delete[](ptr); }
+
+#  if !defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION)
+
+_LIBCPP_WEAK void* operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC {
+  if (size == 0)
+    size = 1;
+  if (static_cast<size_t>(alignment) < sizeof(void*))
+    alignment = std::align_val_t(sizeof(void*));
+
+  // Try allocating memory. If allocation fails and there is a new_handler,
+  // call it to try free up memory, and try again until it succeeds, or until
+  // the new_handler decides to terminate.
+  //
+  // If allocation fails and there is no new_handler, we throw bad_alloc
+  // (or return nullptr if exceptions are disabled).
+  void* p;
+  while ((p = std::__libcpp_aligned_alloc(static_cast<std::size_t>(alignment), size)) == nullptr) {
+    std::new_handler nh = std::get_new_handler();
+    if (nh)
+      nh();
+    else {
+#    ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+      throw std::bad_alloc();
+#    else
+      break;
+#    endif
     }
-    return p;
+  }
+  return p;
 }
 
-_LIBCPP_WEAK
-void*
-operator new(size_t size, const std::nothrow_t&) noexcept
-{
-    void* p = nullptr;
-#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-    try
-    {
-#endif // _LIBCPP_HAS_NO_EXCEPTIONS
-        p = ::operator new(size);
-#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-    }
-    catch (...)
-    {
-    }
-#endif // _LIBCPP_HAS_NO_EXCEPTIONS
-    return p;
-}
-
-_LIBCPP_WEAK
-void*
-operator new[](size_t size) _THROW_BAD_ALLOC
-{
-    return ::operator new(size);
-}
-
-_LIBCPP_WEAK
-void*
-operator new[](size_t size, const std::nothrow_t&) noexcept
-{
-    void* p = nullptr;
-#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-    try
-    {
-#endif // _LIBCPP_HAS_NO_EXCEPTIONS
-        p = ::operator new[](size);
-#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-    }
-    catch (...)
-    {
-    }
-#endif // _LIBCPP_HAS_NO_EXCEPTIONS
-    return p;
-}
-
-_LIBCPP_WEAK
-void
-operator delete(void* ptr) noexcept
-{
-    std::free(ptr);
-}
-
-_LIBCPP_WEAK
-void
-operator delete(void* ptr, const std::nothrow_t&) noexcept
-{
-    ::operator delete(ptr);
-}
-
-_LIBCPP_WEAK
-void
-operator delete(void* ptr, size_t) noexcept
-{
-    ::operator delete(ptr);
-}
-
-_LIBCPP_WEAK
-void
-operator delete[] (void* ptr) noexcept
-{
-    ::operator delete(ptr);
+_LIBCPP_WEAK void* operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept {
+  void* p = nullptr;
+#    ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+  try {
+#    endif // _LIBCPP_HAS_NO_EXCEPTIONS
+    p = ::operator new(size, alignment);
+#    ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+  } catch (...) {
+  }
+#    endif // _LIBCPP_HAS_NO_EXCEPTIONS
+  return p;
 }
 
-_LIBCPP_WEAK
-void
-operator delete[] (void* ptr, const std::nothrow_t&) noexcept
-{
-    ::operator delete[](ptr);
+_LIBCPP_WEAK void* operator new[](size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC {
+  return ::operator new(size, alignment);
 }
 
-_LIBCPP_WEAK
-void
-operator delete[] (void* ptr, size_t) noexcept
-{
-    ::operator delete[](ptr);
+_LIBCPP_WEAK void* operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept {
+  void* p = nullptr;
+#    ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+  try {
+#    endif // _LIBCPP_HAS_NO_EXCEPTIONS
+    p = ::operator new[](size, alignment);
+#    ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+  } catch (...) {
+  }
+#    endif // _LIBCPP_HAS_NO_EXCEPTIONS
+  return p;
 }
 
-#if !defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION)
-
-_LIBCPP_WEAK
-void *
-operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
-{
-    if (size == 0)
-        size = 1;
-    if (static_cast<size_t>(alignment) < sizeof(void*))
-      alignment = std::align_val_t(sizeof(void*));
-
-    // Try allocating memory. If allocation fails and there is a new_handler,
-    // call it to try free up memory, and try again until it succeeds, or until
-    // the new_handler decides to terminate.
-    //
-    // If allocation fails and there is no new_handler, we throw bad_alloc
-    // (or return nullptr if exceptions are disabled).
-    void* p;
-    while ((p = std::__libcpp_aligned_alloc(static_cast<std::size_t>(alignment), size)) == nullptr)
-    {
-        std::new_handler nh = std::get_new_handler();
-        if (nh)
-            nh();
-        else {
-#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-            throw std::bad_alloc();
-#else
-            break;
-#endif
-        }
-    }
-    return p;
-}
-
-_LIBCPP_WEAK
-void*
-operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept
-{
-    void* p = nullptr;
-#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-    try
-    {
-#endif // _LIBCPP_HAS_NO_EXCEPTIONS
-        p = ::operator new(size, alignment);
-#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-    }
-    catch (...)
-    {
-    }
-#endif // _LIBCPP_HAS_NO_EXCEPTIONS
-    return p;
-}
-
-_LIBCPP_WEAK
-void*
-operator new[](size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
-{
-    return ::operator new(size, alignment);
-}
-
-_LIBCPP_WEAK
-void*
-operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept
-{
-    void* p = nullptr;
-#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-    try
-    {
-#endif // _LIBCPP_HAS_NO_EXCEPTIONS
-        p = ::operator new[](size, alignment);
-#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-    }
-    catch (...)
-    {
-    }
-#endif // _LIBCPP_HAS_NO_EXCEPTIONS
-    return p;
-}
-
-_LIBCPP_WEAK
-void
-operator delete(void* ptr, std::align_val_t) noexcept
-{
-    std::__libcpp_aligned_free(ptr);
-}
+_LIBCPP_WEAK void operator delete(void* ptr, std::align_val_t) noexcept { std::__libcpp_aligned_free(ptr); }
 
-_LIBCPP_WEAK
-void
-operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept
-{
-    ::operator delete(ptr, alignment);
+_LIBCPP_WEAK void operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept {
+  ::operator delete(ptr, alignment);
 }
 
-_LIBCPP_WEAK
-void
-operator delete(void* ptr, size_t, std::align_val_t alignment) noexcept
-{
-    ::operator delete(ptr, alignment);
+_LIBCPP_WEAK void operator delete(void* ptr, size_t, std::align_val_t alignment) noexcept {
+  ::operator delete(ptr, alignment);
 }
 
-_LIBCPP_WEAK
-void
-operator delete[] (void* ptr, std::align_val_t alignment) noexcept
-{
-    ::operator delete(ptr, alignment);
+_LIBCPP_WEAK void operator delete[](void* ptr, std::align_val_t alignment) noexcept {
+  ::operator delete(ptr, alignment);
 }
 
-_LIBCPP_WEAK
-void
-operator delete[] (void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept
-{
-    ::operator delete[](ptr, alignment);
+_LIBCPP_WEAK void operator delete[](void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept {
+  ::operator delete[](ptr, alignment);
 }
 
-_LIBCPP_WEAK
-void
-operator delete[] (void* ptr, size_t, std::align_val_t alignment) noexcept
-{
-    ::operator delete[](ptr, alignment);
+_LIBCPP_WEAK void operator delete[](void* ptr, size_t, std::align_val_t alignment) noexcept {
+  ::operator delete[](ptr, alignment);
 }
 
-#endif // !_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
+#  endif // !_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
 // ------------------ END COPY ------------------
 
 #endif // !__GLIBCXX__ && !_LIBCPP_ABI_VCRUNTIME

diff  --git a/libcxx/utils/data/ignore_format.txt b/libcxx/utils/data/ignore_format.txt
index e4f56b00c758343..8a415c1610d452c 100644
--- a/libcxx/utils/data/ignore_format.txt
+++ b/libcxx/utils/data/ignore_format.txt
@@ -525,7 +525,6 @@ libcxx/src/locale.cpp
 libcxx/src/memory.cpp
 libcxx/src/mutex.cpp
 libcxx/src/mutex_destructor.cpp
-libcxx/src/new.cpp
 libcxx/src/optional.cpp
 libcxx/src/pstl/libdispatch.cpp
 libcxx/src/random.cpp

diff  --git a/libcxxabi/src/stdlib_new_delete.cpp b/libcxxabi/src/stdlib_new_delete.cpp
index 080f932ccc60ecf..71c98793cae4093 100644
--- a/libcxxabi/src/stdlib_new_delete.cpp
+++ b/libcxxabi/src/stdlib_new_delete.cpp
@@ -31,236 +31,160 @@
 // that define non-weak copies of the functions.
 
 _LIBCPP_WEAK
-void *
-operator new(std::size_t size) _THROW_BAD_ALLOC
-{
-    if (size == 0)
-        size = 1;
-    void* p;
-    while ((p = std::malloc(size)) == nullptr)
-    {
-        // If malloc fails and there is a new_handler,
-        // call it to try free up memory.
-        std::new_handler nh = std::get_new_handler();
-        if (nh)
-            nh();
-        else
+void* operator new(std::size_t size) _THROW_BAD_ALLOC {
+  if (size == 0)
+    size = 1;
+  void* p;
+  while ((p = std::malloc(size)) == nullptr) {
+    // If malloc fails and there is a new_handler,
+    // call it to try free up memory.
+    std::new_handler nh = std::get_new_handler();
+    if (nh)
+      nh();
+    else
 #ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-            throw std::bad_alloc();
+      throw std::bad_alloc();
 #else
-            break;
+      break;
 #endif
-    }
-    return p;
+  }
+  return p;
 }
 
 _LIBCPP_WEAK
-void*
-operator new(size_t size, const std::nothrow_t&) noexcept
-{
-    void* p = nullptr;
+void* operator new(size_t size, const std::nothrow_t&) noexcept {
+  void* p = nullptr;
 #ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-    try
-    {
+  try {
 #endif // _LIBCPP_HAS_NO_EXCEPTIONS
-        p = ::operator new(size);
+    p = ::operator new(size);
 #ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-    }
-    catch (...)
-    {
-    }
+  } catch (...) {
+  }
 #endif // _LIBCPP_HAS_NO_EXCEPTIONS
-    return p;
+  return p;
 }
 
 _LIBCPP_WEAK
-void*
-operator new[](size_t size) _THROW_BAD_ALLOC
-{
-    return ::operator new(size);
-}
+void* operator new[](size_t size) _THROW_BAD_ALLOC { return ::operator new(size); }
 
 _LIBCPP_WEAK
-void*
-operator new[](size_t size, const std::nothrow_t&) noexcept
-{
-    void* p = nullptr;
+void* operator new[](size_t size, const std::nothrow_t&) noexcept {
+  void* p = nullptr;
 #ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-    try
-    {
+  try {
 #endif // _LIBCPP_HAS_NO_EXCEPTIONS
-        p = ::operator new[](size);
+    p = ::operator new[](size);
 #ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-    }
-    catch (...)
-    {
-    }
+  } catch (...) {
+  }
 #endif // _LIBCPP_HAS_NO_EXCEPTIONS
-    return p;
+  return p;
 }
 
 _LIBCPP_WEAK
-void
-operator delete(void* ptr) noexcept
-{
-    std::free(ptr);
-}
+void operator delete(void* ptr) noexcept { std::free(ptr); }
 
 _LIBCPP_WEAK
-void
-operator delete(void* ptr, const std::nothrow_t&) noexcept
-{
-    ::operator delete(ptr);
-}
+void operator delete(void* ptr, const std::nothrow_t&) noexcept { ::operator delete(ptr); }
 
 _LIBCPP_WEAK
-void
-operator delete(void* ptr, size_t) noexcept
-{
-    ::operator delete(ptr);
-}
+void operator delete(void* ptr, size_t) noexcept { ::operator delete(ptr); }
 
 _LIBCPP_WEAK
-void
-operator delete[] (void* ptr) noexcept
-{
-    ::operator delete(ptr);
-}
+void operator delete[](void* ptr) noexcept { ::operator delete(ptr); }
 
 _LIBCPP_WEAK
-void
-operator delete[] (void* ptr, const std::nothrow_t&) noexcept
-{
-    ::operator delete[](ptr);
-}
+void operator delete[](void* ptr, const std::nothrow_t&) noexcept { ::operator delete[](ptr); }
 
 _LIBCPP_WEAK
-void
-operator delete[] (void* ptr, size_t) noexcept
-{
-    ::operator delete[](ptr);
-}
+void operator delete[](void* ptr, size_t) noexcept { ::operator delete[](ptr); }
 
 #if !defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION)
 
 _LIBCPP_WEAK
-void *
-operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
-{
-    if (size == 0)
-        size = 1;
-    if (static_cast<size_t>(alignment) < sizeof(void*))
-      alignment = std::align_val_t(sizeof(void*));
-
-    // Try allocating memory. If allocation fails and there is a new_handler,
-    // call it to try free up memory, and try again until it succeeds, or until
-    // the new_handler decides to terminate.
-    //
-    // If allocation fails and there is no new_handler, we throw bad_alloc
-    // (or return nullptr if exceptions are disabled).
-    void* p;
-    while ((p = std::__libcpp_aligned_alloc(static_cast<std::size_t>(alignment), size)) == nullptr)
-    {
-        std::new_handler nh = std::get_new_handler();
-        if (nh)
-            nh();
-        else {
-#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-            throw std::bad_alloc();
-#else
-            break;
-#endif
-        }
+void* operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC {
+  if (size == 0)
+    size = 1;
+  if (static_cast<size_t>(alignment) < sizeof(void*))
+    alignment = std::align_val_t(sizeof(void*));
+
+  // Try allocating memory. If allocation fails and there is a new_handler,
+  // call it to try free up memory, and try again until it succeeds, or until
+  // the new_handler decides to terminate.
+  //
+  // If allocation fails and there is no new_handler, we throw bad_alloc
+  // (or return nullptr if exceptions are disabled).
+  void* p;
+  while ((p = std::__libcpp_aligned_alloc(static_cast<std::size_t>(alignment), size)) == nullptr) {
+    std::new_handler nh = std::get_new_handler();
+    if (nh)
+      nh();
+    else {
+#  ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+      throw std::bad_alloc();
+#  else
+      break;
+#  endif
     }
-    return p;
+  }
+  return p;
 }
 
 _LIBCPP_WEAK
-void*
-operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept
-{
-    void* p = nullptr;
-#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-    try
-    {
-#endif // _LIBCPP_HAS_NO_EXCEPTIONS
-        p = ::operator new(size, alignment);
-#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-    }
-    catch (...)
-    {
-    }
-#endif // _LIBCPP_HAS_NO_EXCEPTIONS
-    return p;
+void* operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept {
+  void* p = nullptr;
+#  ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+  try {
+#  endif // _LIBCPP_HAS_NO_EXCEPTIONS
+    p = ::operator new(size, alignment);
+#  ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+  } catch (...) {
+  }
+#  endif // _LIBCPP_HAS_NO_EXCEPTIONS
+  return p;
 }
 
 _LIBCPP_WEAK
-void*
-operator new[](size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
-{
-    return ::operator new(size, alignment);
+void* operator new[](size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC {
+  return ::operator new(size, alignment);
 }
 
 _LIBCPP_WEAK
-void*
-operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept
-{
-    void* p = nullptr;
-#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-    try
-    {
-#endif // _LIBCPP_HAS_NO_EXCEPTIONS
-        p = ::operator new[](size, alignment);
-#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
-    }
-    catch (...)
-    {
-    }
-#endif // _LIBCPP_HAS_NO_EXCEPTIONS
-    return p;
+void* operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept {
+  void* p = nullptr;
+#  ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+  try {
+#  endif // _LIBCPP_HAS_NO_EXCEPTIONS
+    p = ::operator new[](size, alignment);
+#  ifndef _LIBCPP_HAS_NO_EXCEPTIONS
+  } catch (...) {
+  }
+#  endif // _LIBCPP_HAS_NO_EXCEPTIONS
+  return p;
 }
 
 _LIBCPP_WEAK
-void
-operator delete(void* ptr, std::align_val_t) noexcept
-{
-    std::__libcpp_aligned_free(ptr);
-}
+void operator delete(void* ptr, std::align_val_t) noexcept { std::__libcpp_aligned_free(ptr); }
 
 _LIBCPP_WEAK
-void
-operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept
-{
-    ::operator delete(ptr, alignment);
+void operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept {
+  ::operator delete(ptr, alignment);
 }
 
 _LIBCPP_WEAK
-void
-operator delete(void* ptr, size_t, std::align_val_t alignment) noexcept
-{
-    ::operator delete(ptr, alignment);
-}
+void operator delete(void* ptr, size_t, std::align_val_t alignment) noexcept { ::operator delete(ptr, alignment); }
 
 _LIBCPP_WEAK
-void
-operator delete[] (void* ptr, std::align_val_t alignment) noexcept
-{
-    ::operator delete(ptr, alignment);
-}
+void operator delete[](void* ptr, std::align_val_t alignment) noexcept { ::operator delete(ptr, alignment); }
 
 _LIBCPP_WEAK
-void
-operator delete[] (void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept
-{
-    ::operator delete[](ptr, alignment);
+void operator delete[](void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept {
+  ::operator delete[](ptr, alignment);
 }
 
 _LIBCPP_WEAK
-void
-operator delete[] (void* ptr, size_t, std::align_val_t alignment) noexcept
-{
-    ::operator delete[](ptr, alignment);
-}
+void operator delete[](void* ptr, size_t, std::align_val_t alignment) noexcept { ::operator delete[](ptr, alignment); }
 
 #endif // !_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
 // ------------------ END COPY ------------------


        


More information about the libcxx-commits mailing list