diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:25 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:25 +0300 |
commit | 344ea37b4a345701ab0e67de2266a1c1bd7baf2d (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/memory/addstorage.h | |
parent | 706b83ed7de5a473436620367af31fc0ceecde07 (diff) | |
download | ydb-344ea37b4a345701ab0e67de2266a1c1bd7baf2d.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 2 of 2.
Diffstat (limited to 'util/memory/addstorage.h')
-rw-r--r-- | util/memory/addstorage.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/util/memory/addstorage.h b/util/memory/addstorage.h index 53b12c68bd..597c73a988 100644 --- a/util/memory/addstorage.h +++ b/util/memory/addstorage.h @@ -41,15 +41,15 @@ public: return data; } - inline void operator delete(void* ptr) noexcept { + inline void operator delete(void* ptr) noexcept { DoDelete(ptr); } - inline void operator delete(void* ptr, size_t) noexcept { + inline void operator delete(void* ptr, size_t) noexcept { DoDelete(ptr); } - inline void operator delete(void* ptr, size_t, size_t) noexcept { + inline void operator delete(void* ptr, size_t, size_t) noexcept { /* * this delete operator can be called automagically by compiler */ @@ -57,20 +57,20 @@ public: DoDelete(ptr); } - inline void* AdditionalData() const noexcept { + inline void* AdditionalData() const noexcept { return (char*)(static_cast<const T*>(this)) + CombinedSizeOfInstanceWithTInfo(); } - static inline T* ObjectFromData(void* data) noexcept { + static inline T* ObjectFromData(void* data) noexcept { return reinterpret_cast<T*>(static_cast<char*>(data) - CombinedSizeOfInstanceWithTInfo()); } - inline size_t AdditionalDataLength() const noexcept { + inline size_t AdditionalDataLength() const noexcept { return InfoPtr(static_cast<const T*>(this))->Length(); } private: - static inline void DoDelete(void* ptr) noexcept { + static inline void DoDelete(void* ptr) noexcept { TInfo* info = InfoPtr(static_cast<T*>(ptr)); info->~TInfo(); ::operator delete(ptr); |