diff options
author | a-romanov <Anton.Romanov@ydb.tech> | 2023-10-22 18:35:18 +0300 |
---|---|---|
committer | a-romanov <Anton.Romanov@ydb.tech> | 2023-10-22 18:51:29 +0300 |
commit | c9771ff2630c6daed12f07ef0090afa9f062a921 (patch) | |
tree | c011cec39fe82c021f37857a411ad7f2c002d5dd | |
parent | 6a06448fc70344e1420dab5b685f8a6b4ab311c3 (diff) | |
download | ydb-c9771ff2630c6daed12f07ef0090afa9f062a921.tar.gz |
YQL-16757 Add RefCount: useful for debug.
-rw-r--r-- | ydb/library/yql/public/udf/udf_value.h | 1 | ||||
-rw-r--r-- | ydb/library/yql/public/udf/udf_value_inl.h | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/ydb/library/yql/public/udf/udf_value.h b/ydb/library/yql/public/udf/udf_value.h index f6faf46938f..c5364c2f0da 100644 --- a/ydb/library/yql/public/udf/udf_value.h +++ b/ydb/library/yql/public/udf/udf_value.h @@ -885,6 +885,7 @@ public: inline void DeleteUnreferenced() const noexcept; inline i32 LockRef() const noexcept; inline void UnlockRef(i32 prev) const noexcept; + inline i32 RefCount() const noexcept; static constexpr ui32 InternalBufferSize = sizeof(TRaw::Embedded.Buffer); static constexpr ui32 OffsetLimit = 1U << 24U; diff --git a/ydb/library/yql/public/udf/udf_value_inl.h b/ydb/library/yql/public/udf/udf_value_inl.h index d3216ec7c09..d862ede39cc 100644 --- a/ydb/library/yql/public/udf/udf_value_inl.h +++ b/ydb/library/yql/public/udf/udf_value_inl.h @@ -669,6 +669,15 @@ Y_FORCE_INLINE void TUnboxedValuePod::UnlockRef(i32 prev) const noexcept } } +Y_FORCE_INLINE i32 TUnboxedValuePod::RefCount() const noexcept +{ + switch (Raw.GetMarkers()) { + case EMarkers::String: return Raw.String.Value->RefCount(); + case EMarkers::Boxed: return Raw.Boxed.Value->RefCount(); + default: return -1; + } +} + #define VALUE_GET(xType) \ template <> \ inline xType TUnboxedValuePod::Get<xType>() const \ |