Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:13:57

0001 //===----------------------------------------------------------------------===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef _LIBCPP___NEW_GLOBAL_NEW_DELETE_H
0010 #define _LIBCPP___NEW_GLOBAL_NEW_DELETE_H
0011 
0012 #include <__config>
0013 #include <__cstddef/size_t.h>
0014 #include <__new/align_val_t.h>
0015 #include <__new/exceptions.h>
0016 #include <__new/nothrow_t.h>
0017 
0018 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0019 #  pragma GCC system_header
0020 #endif
0021 
0022 #if defined(_LIBCPP_CXX03_LANG)
0023 #  define _THROW_BAD_ALLOC throw(std::bad_alloc)
0024 #else
0025 #  define _THROW_BAD_ALLOC
0026 #endif
0027 
0028 #if defined(__cpp_sized_deallocation) && __cpp_sized_deallocation >= 201309L
0029 #  define _LIBCPP_HAS_SIZED_DEALLOCATION 1
0030 #else
0031 #  define _LIBCPP_HAS_SIZED_DEALLOCATION 0
0032 #endif
0033 
0034 #if defined(_LIBCPP_ABI_VCRUNTIME)
0035 #  include <new.h>
0036 #else
0037 [[__nodiscard__]] _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC;
0038 [[__nodiscard__]] _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT
0039     _LIBCPP_NOALIAS;
0040 _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p) _NOEXCEPT;
0041 _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
0042 #  if _LIBCPP_HAS_SIZED_DEALLOCATION
0043 _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
0044 #  endif
0045 
0046 [[__nodiscard__]] _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz) _THROW_BAD_ALLOC;
0047 [[__nodiscard__]] _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT
0048     _LIBCPP_NOALIAS;
0049 _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p) _NOEXCEPT;
0050 _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;
0051 #  if _LIBCPP_HAS_SIZED_DEALLOCATION
0052 _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::size_t __sz) _NOEXCEPT;
0053 #  endif
0054 
0055 #  if _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION
0056 [[__nodiscard__]] _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
0057 [[__nodiscard__]] _LIBCPP_OVERRIDABLE_FUNC_VIS void*
0058 operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
0059 _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t) _NOEXCEPT;
0060 _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
0061 #    if _LIBCPP_HAS_SIZED_DEALLOCATION
0062 _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
0063 #    endif
0064 
0065 [[__nodiscard__]] _LIBCPP_OVERRIDABLE_FUNC_VIS void*
0066 operator new[](std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
0067 [[__nodiscard__]] _LIBCPP_OVERRIDABLE_FUNC_VIS void*
0068 operator new[](std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS;
0069 _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t) _NOEXCEPT;
0070 _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
0071 #    if _LIBCPP_HAS_SIZED_DEALLOCATION
0072 _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
0073 #    endif
0074 #  endif
0075 #endif
0076 
0077 #endif // _LIBCPP___NEW_GLOBAL_NEW_DELETE_H