aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/memory/chunked_memory_pool-inl.h
diff options
context:
space:
mode:
authorbabenko <babenko@yandex-team.com>2024-08-02 12:04:49 +0300
committerbabenko <babenko@yandex-team.com>2024-08-02 12:18:17 +0300
commit23b7c61b3876a421a9f239646c2f67c70877d21e (patch)
tree080f664dac1dc44ce20cebe488942f1066f0d4be /library/cpp/yt/memory/chunked_memory_pool-inl.h
parent99d0a5c88a19f2a5310c8bfe5ed63ef53e8ce00b (diff)
downloadydb-23b7c61b3876a421a9f239646c2f67c70877d21e.tar.gz
Refactor and unify exit codes
ec1d0c473e709e8aad76b4e190a75ad4125a9ce2
Diffstat (limited to 'library/cpp/yt/memory/chunked_memory_pool-inl.h')
-rw-r--r--library/cpp/yt/memory/chunked_memory_pool-inl.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/library/cpp/yt/memory/chunked_memory_pool-inl.h b/library/cpp/yt/memory/chunked_memory_pool-inl.h
index 58a0cefcc2..2502204160 100644
--- a/library/cpp/yt/memory/chunked_memory_pool-inl.h
+++ b/library/cpp/yt/memory/chunked_memory_pool-inl.h
@@ -6,6 +6,8 @@
#include "serialize.h"
+#include <library/cpp/yt/system/exit.h>
+
#include <library/cpp/yt/malloc/malloc.h>
#include <util/system/align.h>
@@ -30,6 +32,10 @@ TDerived* TAllocationHolder::Allocate(size_t size, TRefCountedTypeCookie cookie)
auto requestedSize = sizeof(TDerived) + size;
auto* ptr = ::malloc(requestedSize);
+ if (!ptr) {
+ AbortProcess(ToUnderlying(EProcessExitCode::OutOfMemory));
+ }
+
#ifndef _win_
auto allocatedSize = ::malloc_usable_size(ptr);
if (allocatedSize) {