diff options
author | danlark <danlark@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
commit | 3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (patch) | |
tree | 26154e1e9990f1bb4525d3e3fb5b6dac2c2c1da2 /contrib/libs/cxxsupp/libcxx/include/new | |
parent | cb68f224c46a8ee52ac3fdd2a32534b8bb8dc134 (diff) | |
download | ydb-3426a9bc7f169ae9da54cef557ad2a33f6e8eee0.tar.gz |
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/include/new')
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/new | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/new b/contrib/libs/cxxsupp/libcxx/include/new index 2d1417a975..84850e8745 100644 --- a/contrib/libs/cxxsupp/libcxx/include/new +++ b/contrib/libs/cxxsupp/libcxx/include/new @@ -1,9 +1,9 @@ // -*- C++ -*- //===----------------------------- new ------------------------------------===// // -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -92,7 +92,7 @@ void operator delete[](void* ptr, void*) noexcept; #include <cstdlib> #include <exception> #include <type_traits> -#include <version> +#include <version> #if defined(_LIBCPP_ABI_VCRUNTIME) #include <new.h> @@ -102,19 +102,19 @@ void operator delete[](void* ptr, void*) noexcept; #pragma GCC system_header #endif -#if !defined(__cpp_sized_deallocation) || __cpp_sized_deallocation < 201309L -#define _LIBCPP_HAS_NO_LANGUAGE_SIZED_DEALLOCATION +#if !defined(__cpp_sized_deallocation) || __cpp_sized_deallocation < 201309L +#define _LIBCPP_HAS_NO_LANGUAGE_SIZED_DEALLOCATION #endif -#if !defined(_LIBCPP_BUILDING_LIBRARY) && _LIBCPP_STD_VER < 14 && \ - defined(_LIBCPP_HAS_NO_LANGUAGE_SIZED_DEALLOCATION) -# define _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION +#if !defined(_LIBCPP_BUILDING_LIBRARY) && _LIBCPP_STD_VER < 14 && \ + defined(_LIBCPP_HAS_NO_LANGUAGE_SIZED_DEALLOCATION) +# define _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION #endif -#if defined(_LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION) || \ - defined(_LIBCPP_HAS_NO_LANGUAGE_SIZED_DEALLOCATION) -# define _LIBCPP_HAS_NO_SIZED_DEALLOCATION -#endif +#if defined(_LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION) || \ + defined(_LIBCPP_HAS_NO_LANGUAGE_SIZED_DEALLOCATION) +# define _LIBCPP_HAS_NO_SIZED_DEALLOCATION +#endif namespace std // purposefully not using versioning namespace { @@ -149,7 +149,7 @@ _LIBCPP_FUNC_VIS new_handler get_new_handler() _NOEXCEPT; _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_bad_alloc(); // not in C++ spec -#if !defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION) && \ +#if !defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION) && \ !defined(_LIBCPP_ABI_VCRUNTIME) #ifndef _LIBCPP_CXX03_LANG enum class _LIBCPP_ENUM_VIS align_val_t : size_t { }; @@ -181,7 +181,7 @@ _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(st _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS; _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p) _NOEXCEPT; _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT; -#ifndef _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION +#ifndef _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operator delete(void* __p, std::size_t __sz) _NOEXCEPT; #endif @@ -189,16 +189,16 @@ _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[]( _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS; _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p) _NOEXCEPT; _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT; -#ifndef _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION +#ifndef _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operator delete[](void* __p, std::size_t __sz) _NOEXCEPT; #endif -#ifndef _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION +#ifndef _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC; _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS; _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t) _NOEXCEPT; _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT; -#ifndef _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION +#ifndef _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operator delete(void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT; #endif @@ -206,7 +206,7 @@ _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[]( _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _LIBCPP_NOALIAS; _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t) _NOEXCEPT; _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT; -#ifndef _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION +#ifndef _LIBCPP_HAS_NO_LIBRARY_SIZED_DEALLOCATION _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operator delete[](void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT; #endif #endif @@ -274,33 +274,33 @@ void __do_deallocate_handle_size(void *__ptr, size_t __size, _Args ...__args) { inline _LIBCPP_INLINE_VISIBILITY void __libcpp_deallocate(void* __ptr, size_t __size, size_t __align) { -#if defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) +#if defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) (void)__align; - return __do_deallocate_handle_size(__ptr, __size); -#else - if (__is_overaligned_for_new(__align)) { - const align_val_t __align_val = static_cast<align_val_t>(__align); - return __do_deallocate_handle_size(__ptr, __size, __align_val); - } else { - return __do_deallocate_handle_size(__ptr, __size); - } -#endif + return __do_deallocate_handle_size(__ptr, __size); +#else + if (__is_overaligned_for_new(__align)) { + const align_val_t __align_val = static_cast<align_val_t>(__align); + return __do_deallocate_handle_size(__ptr, __size, __align_val); + } else { + return __do_deallocate_handle_size(__ptr, __size); + } +#endif } - + inline _LIBCPP_INLINE_VISIBILITY void __libcpp_deallocate_unsized(void* __ptr, size_t __align) { -#if defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) +#if defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) (void)__align; return __libcpp_operator_delete(__ptr); #else - if (__is_overaligned_for_new(__align)) { - const align_val_t __align_val = static_cast<align_val_t>(__align); + if (__is_overaligned_for_new(__align)) { + const align_val_t __align_val = static_cast<align_val_t>(__align); return __libcpp_operator_delete(__ptr, __align_val); - } else { + } else { return __libcpp_operator_delete(__ptr); - } + } #endif } - + #if !defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION) // Low-level helpers to call the aligned allocation and deallocation functions // on the target platform. This is used to implement libc++'s own memory @@ -324,13 +324,13 @@ inline _LIBCPP_INLINE_VISIBILITY void __libcpp_aligned_free(void* __ptr) { #if defined(_LIBCPP_MSVCRT_LIKE) ::_aligned_free(__ptr); -#else +#else ::free(__ptr); #endif } #endif // !_LIBCPP_HAS_NO_ALIGNED_ALLOCATION - + template <class _Tp> _LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __launder(_Tp* __p) _NOEXCEPT |