diff options
author | Alexey Filinovich <aleex.fil@yandex.com> | 2023-09-07 14:32:19 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2023-09-07 15:24:13 +0300 |
commit | 9ef7cfd485f762234c31818dccb52b341d68cc36 (patch) | |
tree | 190c6da275547084ccffc3128f6d8d4d6423f039 | |
parent | 9b7ff4229e585fd3aec79ac556e5d5c40a7d2dd2 (diff) | |
download | ydb-9ef7cfd485f762234c31818dccb52b341d68cc36.tar.gz |
[Sync from ytsaurus/ytsaurus] Put attribute(weak) in a GCC-compatible position
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
In addition to #89, there is one more minor fix. GCC doesn't allow putting `__attribute__((weak))` before the `extern "C"` and produces non-weak symbols. Proof: https://godbolt.org/z/h48fYsGMW
---
Pull Request resolved: #96
-rw-r--r-- | library/cpp/yt/malloc/malloc.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/cpp/yt/malloc/malloc.cpp b/library/cpp/yt/malloc/malloc.cpp index 2455970b71..de45aa37fa 100644 --- a/library/cpp/yt/malloc/malloc.cpp +++ b/library/cpp/yt/malloc/malloc.cpp @@ -7,13 +7,13 @@ //////////////////////////////////////////////////////////////////////////////// -Y_WEAK extern "C" size_t nallocx(size_t size, int /*flags*/) noexcept +extern "C" Y_WEAK 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 +extern "C" Y_WEAK size_t malloc_usable_size(void* /*ptr*/) noexcept { return 0; } |