diff options
author | monster <monster@yandex-team.ru> | 2022-02-10 16:47:19 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:19 +0300 |
commit | b23c1d7a8015c2006a148fd93b84cdeb0aee17a3 (patch) | |
tree | 9814fbd1c3effac9b8377c5d604b367b14e2db55 /library/cpp/actors/prof/tcmalloc.cpp | |
parent | dd76ae1f6213d065375ab296699f764faafbe5bd (diff) | |
download | ydb-b23c1d7a8015c2006a148fd93b84cdeb0aee17a3.tar.gz |
Restoring authorship annotation for <monster@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/actors/prof/tcmalloc.cpp')
-rw-r--r-- | library/cpp/actors/prof/tcmalloc.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/library/cpp/actors/prof/tcmalloc.cpp b/library/cpp/actors/prof/tcmalloc.cpp index 331181e80b..3d4f203dbb 100644 --- a/library/cpp/actors/prof/tcmalloc.cpp +++ b/library/cpp/actors/prof/tcmalloc.cpp @@ -1,32 +1,32 @@ -#include "tcmalloc.h" - -#include <contrib/libs/tcmalloc/tcmalloc/malloc_extension.h> - -namespace NProfiling { - -static thread_local ui32 AllocationTag = 0; - -static struct TInitTCMallocCallbacks { - static void* CreateTag() { - return reinterpret_cast<void*>(AllocationTag); - } - static void* CopyTag(void* tag) { - return tag; - } - static void DestroyTag(void* tag) { - Y_UNUSED(tag); - } - - TInitTCMallocCallbacks() { - tcmalloc::MallocExtension::SetSampleUserDataCallbacks( - CreateTag, CopyTag, DestroyTag); - } -} InitTCMallocCallbacks; - -ui32 SetTCMallocThreadAllocTag(ui32 tag) { - ui32 prev = AllocationTag; - AllocationTag = tag; - return prev; -} - -} +#include "tcmalloc.h" + +#include <contrib/libs/tcmalloc/tcmalloc/malloc_extension.h> + +namespace NProfiling { + +static thread_local ui32 AllocationTag = 0; + +static struct TInitTCMallocCallbacks { + static void* CreateTag() { + return reinterpret_cast<void*>(AllocationTag); + } + static void* CopyTag(void* tag) { + return tag; + } + static void DestroyTag(void* tag) { + Y_UNUSED(tag); + } + + TInitTCMallocCallbacks() { + tcmalloc::MallocExtension::SetSampleUserDataCallbacks( + CreateTag, CopyTag, DestroyTag); + } +} InitTCMallocCallbacks; + +ui32 SetTCMallocThreadAllocTag(ui32 tag) { + ui32 prev = AllocationTag; + AllocationTag = tag; + return prev; +} + +} |