diff options
| author | sabdenovch <[email protected]> | 2026-04-20 10:26:29 +0300 |
|---|---|---|
| committer | sabdenovch <[email protected]> | 2026-04-20 11:19:22 +0300 |
| commit | 4cc746cfd430c45107cdbe355db65c828614a8a1 (patch) | |
| tree | 9082fadf6e8b359d65ef832cd92aca1e82f621a9 /library | |
| parent | 1af2d246a4f146240b86836c6272642f0f15c29e (diff) | |
Poison memory in allocation holders
commit_hash:0912d7a08b0b2ae26b6298108a9fdd57cabbc77a
Diffstat (limited to 'library')
| -rw-r--r-- | library/cpp/yt/memory/ref.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/library/cpp/yt/memory/ref.cpp b/library/cpp/yt/memory/ref.cpp index 5a6ca1e3373..1743680b581 100644 --- a/library/cpp/yt/memory/ref.cpp +++ b/library/cpp/yt/memory/ref.cpp @@ -3,6 +3,7 @@ #include "blob.h" #include <library/cpp/yt/malloc/malloc.h> +#include <library/cpp/yt/memory/poison.h> #include <library/cpp/yt/misc/port.h> @@ -99,6 +100,7 @@ class TAllocationHolderBase public: ~TAllocationHolderBase() { + PoisonFreedMemory(GetRef()); #ifdef YT_ENABLE_REF_COUNTED_TRACKING TRefCountedTrackerFacade::FreeTagInstance(Cookie_); TRefCountedTrackerFacade::FreeSpace(Cookie_, Size_); @@ -129,6 +131,8 @@ protected: #endif if (options.InitializeStorage) { ::memset(static_cast<TDerived*>(this)->GetBegin(), 0, Size_); + } else { + PoisonUninitializedMemory(GetRef()); } #ifdef YT_ENABLE_REF_COUNTED_TRACKING TRefCountedTrackerFacade::AllocateTagInstance(Cookie_); |
