aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/malloc/malloc.cpp
diff options
context:
space:
mode:
authoraleexfi <aleexfi@yandex-team.com>2023-01-10 00:35:59 +0300
committeraleexfi <aleexfi@yandex-team.com>2023-01-10 00:35:59 +0300
commit7ade5ad16d098a48b1586948baae4f9b2fa1dbb5 (patch)
tree0729c2775c7396df1652e638da561be3d88c8b2f /library/cpp/yt/malloc/malloc.cpp
parent2d79b278f2265d09c965faf97288acceb21da600 (diff)
downloadydb-7ade5ad16d098a48b1586948baae4f9b2fa1dbb5.tar.gz
Add nallocx impl on windows; Remove dependence on allocator coz it doesn't work
Diffstat (limited to 'library/cpp/yt/malloc/malloc.cpp')
-rw-r--r--library/cpp/yt/malloc/malloc.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/library/cpp/yt/malloc/malloc.cpp b/library/cpp/yt/malloc/malloc.cpp
index abb04e60f9..2455970b71 100644
--- a/library/cpp/yt/malloc/malloc.cpp
+++ b/library/cpp/yt/malloc/malloc.cpp
@@ -1,11 +1,24 @@
#include "malloc.h"
+#include <util/system/compiler.h>
#include <util/system/platform.h>
#include <stdlib.h>
////////////////////////////////////////////////////////////////////////////////
+Y_WEAK extern "C" size_t nallocx(size_t size, int /*flags*/) noexcept
+{
+ return size;
+}
+
+#ifndef _win_
+Y_WEAK extern "C" size_t malloc_usable_size(void* /*ptr*/) noexcept
+{
+ return 0;
+}
+#endif
+
void* aligned_malloc(size_t size, size_t alignment)
{
#if defined(_win_)