diff options
author | ironpeter <ironpeter@yandex-team.ru> | 2022-02-10 16:49:51 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:51 +0300 |
commit | ff97837ecc5972a00cb395483d8856566738375c (patch) | |
tree | b2e9b0b27c06242cc2390f3fe726bd2d40758c8f /library/cpp/lfalloc | |
parent | ec31dbabb2178819f10e1dec8f2ae9b2ba551ab1 (diff) | |
download | ydb-ff97837ecc5972a00cb395483d8856566738375c.tar.gz |
Restoring authorship annotation for <ironpeter@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/lfalloc')
-rw-r--r-- | library/cpp/lfalloc/lf_allocX64.cpp | 2 | ||||
-rw-r--r-- | library/cpp/lfalloc/lf_allocX64.h | 40 |
2 files changed, 21 insertions, 21 deletions
diff --git a/library/cpp/lfalloc/lf_allocX64.cpp b/library/cpp/lfalloc/lf_allocX64.cpp index 2eb90761fe..2a06e778ec 100644 --- a/library/cpp/lfalloc/lf_allocX64.cpp +++ b/library/cpp/lfalloc/lf_allocX64.cpp @@ -1,5 +1,5 @@ #include "lf_allocX64.h" - + ////////////////////////////////////////////////////////////////////////// // hooks #if defined(USE_INTELCC) || defined(_darwin_) || defined(_freebsd_) || defined(_STLPORT_VERSION) diff --git a/library/cpp/lfalloc/lf_allocX64.h b/library/cpp/lfalloc/lf_allocX64.h index fd2a906d6f..eace32fd97 100644 --- a/library/cpp/lfalloc/lf_allocX64.h +++ b/library/cpp/lfalloc/lf_allocX64.h @@ -1,9 +1,9 @@ #pragma once -#include <stdlib.h> -#include <stdio.h> -#include <stdarg.h> - +#include <stdlib.h> +#include <stdio.h> +#include <stdarg.h> + #include <library/cpp/malloc/api/malloc.h> #include <util/system/compat.h> @@ -442,7 +442,7 @@ static void LargeBlockUnmap(void* p, size_t pages) { ////////////////////////////////////////////////////////////////////////// const size_t LB_BUF_SIZE = 250; -const size_t LB_BUF_HASH = 977; +const size_t LB_BUF_HASH = 977; static int LB_LIMIT_TOTAL_SIZE = 500 * 1024 * 1024 / 4096; // do not keep more then this mem total in lbFreePtrs[] static void* volatile lbFreePtrs[LB_BUF_HASH][LB_BUF_SIZE]; static TAtomic lbFreePageCount; @@ -1120,7 +1120,7 @@ struct TThreadAllocInfo { i = THREAD_BUF; #ifdef _win_ BOOL b = DuplicateHandle( - GetCurrentProcess(), GetCurrentThread(), + GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hThread, 0, FALSE, DUPLICATE_SAME_ACCESS); Y_ASSERT_NOBT(b); @@ -1305,7 +1305,7 @@ static void AllocThreadInfo() { ////////////////////////////////////////////////////////////////////////// #if defined(LFALLOC_DBG) - + struct TAllocHeader { uint64_t Size; int Tag; @@ -1529,18 +1529,18 @@ static Y_FORCE_INLINE void* LFAllocImpl(size_t _nSize) { // check per thread buffer TThreadAllocInfo* thr = pThreadInfo; - if (!thr) { - AllocThreadInfo(); - thr = pThreadInfo; - if (!thr) { + if (!thr) { + AllocThreadInfo(); + thr = pThreadInfo; + if (!thr) { void* ptr = LFAllocNoCache(nSizeIdx, MEM_DEFRAG); #if defined(LFALLOC_DBG) ptr = TrackAllocation(ptr, size, nSizeIdx); #endif return ptr; - } - } - { + } + } + { int& freePtrIdx = thr->FreePtrIndex[nSizeIdx]; if (freePtrIdx < THREAD_BUF) { void* ptr = thr->FreePtrs[nSizeIdx][freePtrIdx++]; @@ -1568,7 +1568,7 @@ static Y_FORCE_INLINE void* LFAllocImpl(size_t _nSize) { ptr = TrackAllocation(ptr, size, nSizeIdx); #endif return ptr; - } + } } static Y_FORCE_INLINE void* LFAlloc(size_t _nSize) { @@ -1792,13 +1792,13 @@ static void DumpMemoryBlockUtilizationLocked() { } void FlushThreadFreeList() { - if (pThreadInfo) - MoveSingleThreadFreeToGlobal(pThreadInfo); -} - + if (pThreadInfo) + MoveSingleThreadFreeToGlobal(pThreadInfo); +} + void DumpMemoryBlockUtilization() { // move current thread free to global lists to get better statistics - FlushThreadFreeList(); + FlushThreadFreeList(); { TLFLockHolder ls(&LFGlobalLock); DumpMemoryBlockUtilizationLocked(); |