aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-07-04 10:25:18 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-07-04 10:25:18 +0300
commitad3673bd122c64ecbf79768cee154cd766fddbaa (patch)
treea9c4d1cc75a88ee9df20edea0ea3fd621cd37aa3 /library/cpp
parente9e74c9bd8831f3c354a56d443a00d45ca0eb59c (diff)
downloadydb-ad3673bd122c64ecbf79768cee154cd766fddbaa.tar.gz
intermediate changes
ref:eb323ed6990ec25c44f6fff39b4c6e695146549d
Diffstat (limited to 'library/cpp')
-rw-r--r--library/cpp/containers/stack_vector/stack_vec.h3
-rw-r--r--library/cpp/yt/memory/ref_counted.h12
-rw-r--r--library/cpp/yt/misc/port.h10
3 files changed, 12 insertions, 13 deletions
diff --git a/library/cpp/containers/stack_vector/stack_vec.h b/library/cpp/containers/stack_vector/stack_vec.h
index fcc5d9a2a5..ea648767ae 100644
--- a/library/cpp/containers/stack_vector/stack_vec.h
+++ b/library/cpp/containers/stack_vector/stack_vec.h
@@ -45,7 +45,8 @@ namespace NPrivate {
};
public:
- TStackBasedAllocator() = default;
+ //NOTE: it is important to make this syntax; using =default will lead to memset https://godbolt.org/z/vTqzK9aWr
+ TStackBasedAllocator() noexcept {};
template <
typename... TArgs,
diff --git a/library/cpp/yt/memory/ref_counted.h b/library/cpp/yt/memory/ref_counted.h
index b683615b83..ffc81bb6d1 100644
--- a/library/cpp/yt/memory/ref_counted.h
+++ b/library/cpp/yt/memory/ref_counted.h
@@ -149,9 +149,9 @@ using TRefCountedPtr = TIntrusivePtr<TRefCounted>;
#define DECLARE_REFCOUNTED_TYPE(type) \
using type ## Ptr = ::NYT::TIntrusivePtr<type>; \
\
- [[maybe_unused]] ATTRIBUTE_USED const ::NYT::TRefCounter* GetRefCounter(const type* obj); \
- [[maybe_unused]] ATTRIBUTE_USED void DestroyRefCounted(const type* obj); \
- [[maybe_unused]] ATTRIBUTE_USED void DeallocateRefCounted(const type* obj);
+ [[maybe_unused]] YT_ATTRIBUTE_USED const ::NYT::TRefCounter* GetRefCounter(const type* obj); \
+ [[maybe_unused]] YT_ATTRIBUTE_USED void DestroyRefCounted(const type* obj); \
+ [[maybe_unused]] YT_ATTRIBUTE_USED void DeallocateRefCounted(const type* obj);
//! Forward-declares a class type, defines an intrusive pointer for it, and finally
//! declares Ref/Unref overloads. Use this macro in |public.h|-like files.
@@ -168,15 +168,15 @@ using TRefCountedPtr = TIntrusivePtr<TRefCounted>;
//! Provides implementations for Ref/Unref overloads. Use this macro right
//! after the type's full definition.
#define DEFINE_REFCOUNTED_TYPE(type) \
- [[maybe_unused]] ATTRIBUTE_USED Y_FORCE_INLINE const ::NYT::TRefCounter* GetRefCounter(const type* obj) \
+ [[maybe_unused]] YT_ATTRIBUTE_USED Y_FORCE_INLINE const ::NYT::TRefCounter* GetRefCounter(const type* obj) \
{ \
return ::NYT::TRefCountedHelper<type>::GetRefCounter(obj); \
} \
- [[maybe_unused]] ATTRIBUTE_USED Y_FORCE_INLINE void DestroyRefCounted(const type* obj) \
+ [[maybe_unused]] YT_ATTRIBUTE_USED Y_FORCE_INLINE void DestroyRefCounted(const type* obj) \
{ \
::NYT::TRefCountedHelper<type>::Destroy(obj); \
} \
- [[maybe_unused]] ATTRIBUTE_USED Y_FORCE_INLINE void DeallocateRefCounted(const type* obj) \
+ [[maybe_unused]] YT_ATTRIBUTE_USED Y_FORCE_INLINE void DeallocateRefCounted(const type* obj) \
{ \
::NYT::TRefCountedHelper<type>::Deallocate(obj); \
}
diff --git a/library/cpp/yt/misc/port.h b/library/cpp/yt/misc/port.h
index b24ac50995..223d6a893c 100644
--- a/library/cpp/yt/misc/port.h
+++ b/library/cpp/yt/misc/port.h
@@ -57,14 +57,12 @@
#endif
#if defined(__GNUC__) || defined(__clang__)
- #define PER_THREAD __thread
- #define ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
+ #define YT_ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
// Prevent GCC from throwing out functions in release builds.
- #define ATTRIBUTE_USED __attribute__((used))
+ #define YT_ATTRIBUTE_USED __attribute__((used))
#elif defined(_MSC_VER)
- #define PER_THREAD __declspec(thread)
- #define ATTRIBUTE_NO_SANITIZE_ADDRESS
- #define ATTRIBUTE_USED
+ #define YT_ATTRIBUTE_NO_SANITIZE_ADDRESS
+ #define YT_ATTRIBUTE_USED
#else
#error Unsupported compiler
#endif