diff options
author | babenko <babenko@yandex-team.com> | 2022-08-08 23:32:27 +0300 |
---|---|---|
committer | babenko <babenko@yandex-team.com> | 2022-08-08 23:32:27 +0300 |
commit | 6f0dca4575782eca7bfe2d9160574767444c4f06 (patch) | |
tree | a5dad3d0eceb2d02929db1c843c69eafba632c27 /library/cpp/yt/memory/new-inl.h | |
parent | 97756e1f8069e2de8c4b5d27a358fa0c7eb29169 (diff) | |
download | ydb-6f0dca4575782eca7bfe2d9160574767444c4f06.tar.gz |
Get rid of NYTAlloc::GetAllocationSize usages
Diffstat (limited to 'library/cpp/yt/memory/new-inl.h')
-rw-r--r-- | library/cpp/yt/memory/new-inl.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/library/cpp/yt/memory/new-inl.h b/library/cpp/yt/memory/new-inl.h index 0a84818516..5d5fcc45c4 100644 --- a/library/cpp/yt/memory/new-inl.h +++ b/library/cpp/yt/memory/new-inl.h @@ -6,6 +6,8 @@ #include <library/cpp/ytalloc/api/ytalloc.h> +#include <library/cpp/yt/malloc//malloc.h> + namespace NYT { //////////////////////////////////////////////////////////////////////////////// @@ -305,6 +307,16 @@ void* TWithExtraSpace<T>::GetExtraSpacePtr() return static_cast<T*>(this) + 1; } +template <class T> +size_t TWithExtraSpace<T>::GetUsableSpaceSize() const +{ +#ifdef _win_ + return 0; +#else + return malloc_usable_size(const_cast<T*>(static_cast<const T*>(this))) - sizeof(T); +#endif +} + //////////////////////////////////////////////////////////////////////////////// } // namespace NYT |