From 2d2b44e7bb98a0bdf31071e47669cb5da1c0a4cf Mon Sep 17 00:00:00 2001 From: sabdenovch Date: Mon, 18 May 2026 12:45:35 +0300 Subject: Cosmetics, take 2 commit_hash:3210c0fdd660724baf1a21334f02a76448392ba2 --- yt/yt/client/table_client/row_buffer-inl.h | 39 ++++++++++++++++++++++++++++++ yt/yt/client/table_client/row_buffer.h | 25 ++++++------------- yt/yt/core/concurrency/public.h | 2 ++ 3 files changed, 49 insertions(+), 17 deletions(-) create mode 100644 yt/yt/client/table_client/row_buffer-inl.h diff --git a/yt/yt/client/table_client/row_buffer-inl.h b/yt/yt/client/table_client/row_buffer-inl.h new file mode 100644 index 00000000000..601f3df6021 --- /dev/null +++ b/yt/yt/client/table_client/row_buffer-inl.h @@ -0,0 +1,39 @@ +#ifndef ROW_BUFFER_INL_H_ +#error "Direct inclusion of this file is not allowed, include row_buffer.h" +// For the sake of sane code completion. +#include "row_buffer.h" +#endif +#undef ROW_BUFFER_INL_H_ + +namespace NYT::NTableClient { + +//////////////////////////////////////////////////////////////////////////////// + +template +TRowBuffer::TRowBuffer( + TTag /*tag*/, + size_t startChunkSize, + IMemoryUsageTrackerPtr tracker, + bool allowMemoryOvercommit) + : Pool_( + GetRefCountedTypeCookie(), + GetTrackedMemoryChunkProvider(std::move(tracker), allowMemoryOvercommit), + startChunkSize) +{ + static_assert(IsEmptyClass()); +} + +template +TRowBuffer::TRowBuffer( + TTag /*tag*/, + IMemoryChunkProviderPtr chunkProvider) + : Pool_( + GetRefCountedTypeCookie(), + std::move(chunkProvider)) +{ + static_assert(IsEmptyClass()); +} + +//////////////////////////////////////////////////////////////////////////////// + +} // namespace NYT::NTableClient diff --git a/yt/yt/client/table_client/row_buffer.h b/yt/yt/client/table_client/row_buffer.h index 47ef3d12faf..422ea20c63b 100644 --- a/yt/yt/client/table_client/row_buffer.h +++ b/yt/yt/client/table_client/row_buffer.h @@ -26,17 +26,10 @@ class TRowBuffer public: template explicit TRowBuffer( - TTag /*tag*/ = TDefaultRowBufferPoolTag(), + TTag tag = TDefaultRowBufferPoolTag(), size_t startChunkSize = TChunkedMemoryPool::DefaultStartChunkSize, IMemoryUsageTrackerPtr tracker = nullptr, - bool allowMemoryOvercommit = false) - : Pool_( - GetRefCountedTypeCookie(), - GetTrackedMemoryChunkProvider(std::move(tracker), allowMemoryOvercommit), - startChunkSize) - { - static_assert(IsEmptyClass()); - } + bool allowMemoryOvercommit = false); TRowBuffer( TRefCountedTypeCookie tagCookie, @@ -45,14 +38,8 @@ public: template TRowBuffer( - TTag /*tag*/, - IMemoryChunkProviderPtr chunkProvider) - : Pool_( - GetRefCountedTypeCookie(), - std::move(chunkProvider)) - { - static_assert(IsEmptyClass()); - } + TTag tag, + IMemoryChunkProviderPtr chunkProvider); TChunkedMemoryPool* GetPool(); @@ -119,3 +106,7 @@ DEFINE_REFCOUNTED_TYPE(TRowBuffer) //////////////////////////////////////////////////////////////////////////////// } // namespace NYT::NTableClient + +#define ROW_BUFFER_INL_H_ +#include "row_buffer-inl.h" +#undef ROW_BUFFER_INL_H_ diff --git a/yt/yt/core/concurrency/public.h b/yt/yt/core/concurrency/public.h index ece3aa9318e..981c04ea821 100644 --- a/yt/yt/core/concurrency/public.h +++ b/yt/yt/core/concurrency/public.h @@ -129,6 +129,8 @@ class TPropagatingStorage; YT_DECLARE_RECONFIGURABLE_SINGLETON(TFiberManagerConfig, TFiberManagerDynamicConfig); +// UDFs importing core yt headers cannot compile if a dynamically initialized and +// destroyed global object, such as inline const std::string, is present. extern const TFairShareThreadPoolTag DefaultExecutionTag; //////////////////////////////////////////////////////////////////////////////// -- cgit v1.3