diff options
author | Ilnur Khuziev <ilnur.khuziev@yandex.ru> | 2022-02-10 16:46:14 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:14 +0300 |
commit | 60040c91ffe701a84689b2c6310ff845e65cff42 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/lfalloc | |
parent | 736dcd8ca259457a136f2f9f9168c44643914323 (diff) | |
download | ydb-60040c91ffe701a84689b2c6310ff845e65cff42.tar.gz |
Restoring authorship annotation for Ilnur Khuziev <ilnur.khuziev@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/lfalloc')
-rw-r--r-- | library/cpp/lfalloc/alloc_profiler/profiler.h | 2 | ||||
-rw-r--r-- | library/cpp/lfalloc/alloc_profiler/profiler_ut.cpp | 2 | ||||
-rw-r--r-- | library/cpp/lfalloc/alloc_profiler/stackcollect.h | 4 | ||||
-rw-r--r-- | library/cpp/lfalloc/alloc_profiler/ut/ya.make | 4 | ||||
-rw-r--r-- | library/cpp/lfalloc/alloc_profiler/ya.make | 4 | ||||
-rw-r--r-- | library/cpp/lfalloc/lf_allocX64.h | 82 |
6 files changed, 49 insertions, 49 deletions
diff --git a/library/cpp/lfalloc/alloc_profiler/profiler.h b/library/cpp/lfalloc/alloc_profiler/profiler.h index c07a6c0be6..4ea49b9dcc 100644 --- a/library/cpp/lfalloc/alloc_profiler/profiler.h +++ b/library/cpp/lfalloc/alloc_profiler/profiler.h @@ -2,7 +2,7 @@ #include "stackcollect.h" -#include <library/cpp/lfalloc/dbg_info/dbg_info.h> +#include <library/cpp/lfalloc/dbg_info/dbg_info.h> #include <util/generic/noncopyable.h> #include <util/stream/output.h> diff --git a/library/cpp/lfalloc/alloc_profiler/profiler_ut.cpp b/library/cpp/lfalloc/alloc_profiler/profiler_ut.cpp index 54acf18e71..4341dda6ed 100644 --- a/library/cpp/lfalloc/alloc_profiler/profiler_ut.cpp +++ b/library/cpp/lfalloc/alloc_profiler/profiler_ut.cpp @@ -1,6 +1,6 @@ #include "profiler.h" -#include <library/cpp/testing/unittest/registar.h> +#include <library/cpp/testing/unittest/registar.h> namespace NAllocProfiler { diff --git a/library/cpp/lfalloc/alloc_profiler/stackcollect.h b/library/cpp/lfalloc/alloc_profiler/stackcollect.h index f90687d3cd..80715ed7cb 100644 --- a/library/cpp/lfalloc/alloc_profiler/stackcollect.h +++ b/library/cpp/lfalloc/alloc_profiler/stackcollect.h @@ -1,7 +1,7 @@ #pragma once -#include <library/cpp/containers/stack_vector/stack_vec.h> -#include <library/cpp/cache/cache.h> +#include <library/cpp/containers/stack_vector/stack_vec.h> +#include <library/cpp/cache/cache.h> #include <util/generic/noncopyable.h> #include <util/generic/ptr.h> diff --git a/library/cpp/lfalloc/alloc_profiler/ut/ya.make b/library/cpp/lfalloc/alloc_profiler/ut/ya.make index 64906384c1..8a7daa74af 100644 --- a/library/cpp/lfalloc/alloc_profiler/ut/ya.make +++ b/library/cpp/lfalloc/alloc_profiler/ut/ya.make @@ -1,9 +1,9 @@ -UNITTEST_FOR(library/cpp/lfalloc/alloc_profiler) +UNITTEST_FOR(library/cpp/lfalloc/alloc_profiler) OWNER(g:rtmr g:kikimr) PEERDIR( - library/cpp/testing/unittest + library/cpp/testing/unittest ) IF (ARCH_AARCH64) diff --git a/library/cpp/lfalloc/alloc_profiler/ya.make b/library/cpp/lfalloc/alloc_profiler/ya.make index dd6d6fe13e..0f58d91767 100644 --- a/library/cpp/lfalloc/alloc_profiler/ya.make +++ b/library/cpp/lfalloc/alloc_profiler/ya.make @@ -8,8 +8,8 @@ SRCS( ) PEERDIR( - library/cpp/lfalloc/dbg_info - library/cpp/cache + library/cpp/lfalloc/dbg_info + library/cpp/cache ) END() diff --git a/library/cpp/lfalloc/lf_allocX64.h b/library/cpp/lfalloc/lf_allocX64.h index b9dcc3d46f..fd2a906d6f 100644 --- a/library/cpp/lfalloc/lf_allocX64.h +++ b/library/cpp/lfalloc/lf_allocX64.h @@ -53,7 +53,7 @@ static inline long AtomicSub(TAtomic& a, long b) { assert(x); \ } #else -#define Y_ASSERT_NOBT(x) ((void)0) +#define Y_ASSERT_NOBT(x) ((void)0) #endif #else @@ -62,35 +62,35 @@ static inline long AtomicSub(TAtomic& a, long b) { #include <util/system/atomic.h> #include <util/system/yassert.h> -#if !defined(NDEBUG) && !defined(__GCCXML__) -#define Y_ASSERT_NOBT(a) \ - do { \ - try { \ - if (Y_UNLIKELY(!(a))) { \ - if (YaIsDebuggerPresent()) \ - __debugbreak(); \ - else { \ - assert(false && (a)); \ - } \ - } \ - } catch (...) { \ - if (YaIsDebuggerPresent()) \ - __debugbreak(); \ - else { \ - assert(false && "Exception during assert"); \ - } \ - } \ - } while (0) -#else -#define Y_ASSERT_NOBT(a) \ - do { \ - if (false) { \ - bool __xxx = static_cast<bool>(a); \ - Y_UNUSED(__xxx); \ - } \ - } while (0) -#endif - +#if !defined(NDEBUG) && !defined(__GCCXML__) +#define Y_ASSERT_NOBT(a) \ + do { \ + try { \ + if (Y_UNLIKELY(!(a))) { \ + if (YaIsDebuggerPresent()) \ + __debugbreak(); \ + else { \ + assert(false && (a)); \ + } \ + } \ + } catch (...) { \ + if (YaIsDebuggerPresent()) \ + __debugbreak(); \ + else { \ + assert(false && "Exception during assert"); \ + } \ + } \ + } while (0) +#else +#define Y_ASSERT_NOBT(a) \ + do { \ + if (false) { \ + bool __xxx = static_cast<bool>(a); \ + Y_UNUSED(__xxx); \ + } \ + } while (0) +#endif + #include <pthread.h> #include <sys/mman.h> #include <stdlib.h> @@ -433,7 +433,7 @@ static void LargeBlockUnmap(void* p, size_t pages) { IncrementCounter(CT_MUNMAP, bytes); IncrementCounter(CT_MUNMAP_CNT, 1); #ifdef _MSC_VER - Y_ASSERT_NOBT(0); + Y_ASSERT_NOBT(0); #else TLargeBlk::As(p)->Mark(ELarge::Gone); munmap((char*)p - 4096ll, bytes); @@ -796,7 +796,7 @@ static bool DefragmentMem() { if (pData) { uintptr_t nChunk = (pData - ALLOC_START) / N_CHUNK_SIZE; ++nFreeCount[nChunk]; - Y_ASSERT_NOBT(chunkSizeIdx[nChunk] == nSizeIdx); + Y_ASSERT_NOBT(chunkSizeIdx[nChunk] == nSizeIdx); } } } @@ -809,7 +809,7 @@ static bool DefragmentMem() { if (chunkSizeIdx[nChunk] <= 0) continue; int nEntries = N_CHUNK_SIZE / nSizeIdxToSize[static_cast<int>(chunkSizeIdx[nChunk])]; - Y_ASSERT_NOBT(fc <= nEntries); // can not have more free blocks then total count + Y_ASSERT_NOBT(fc <= nEntries); // can not have more free blocks then total count if (fc == nEntries) { bRes = true; nFreeCount[nChunk] = 1; @@ -905,7 +905,7 @@ static void* SlowLFAlloc(int nSizeIdx, int blockSize, EDefrag defrag) { char* newPlace = ALLOC_START + nChunk * N_CHUNK_SIZE; #ifdef _MSC_VER void* pTest = VirtualAlloc(newPlace, N_CHUNK_SIZE, MEM_COMMIT, PAGE_READWRITE); - Y_ASSERT_NOBT(pTest == newPlace); + Y_ASSERT_NOBT(pTest == newPlace); #endif chunkSizeIdx[nChunk] = (char)nSizeIdx; globalCurrentPtr[nSizeIdx] = newPlace + blockSize; @@ -922,8 +922,8 @@ static void* SlowLFAlloc(int nSizeIdx, int blockSize, EDefrag defrag) { uintptr_t endAddr = ((largeBlock - ALLOC_START) + N_LARGE_ALLOC_SIZE) & (~(N_CHUNK_SIZE - 1)); for (uintptr_t p = addr; p < endAddr; p += N_CHUNK_SIZE) { uintptr_t chunk = p / N_CHUNK_SIZE; - Y_ASSERT_NOBT(chunk * N_CHUNK_SIZE == p); - Y_ASSERT_NOBT(chunkSizeIdx[chunk] == 0); + Y_ASSERT_NOBT(chunk * N_CHUNK_SIZE == p); + Y_ASSERT_NOBT(chunkSizeIdx[chunk] == 0); AddFreeChunk(chunk); } } @@ -980,7 +980,7 @@ static Y_FORCE_INLINE int TakeBlocksFromGlobalFreeList(int nSizeIdx, char** buf) static Y_FORCE_INLINE void PutBlocksToGlobalFreeList(ptrdiff_t nSizeIdx, char** buf, int count) { for (int startIdx = 0; startIdx < count;) { TFreeListGroup* g = (TFreeListGroup*)blockFreeList.Alloc(); - Y_ASSERT_NOBT(sizeof(TFreeListGroup) == nSizeIdxToSize[FREE_LIST_GROUP_SIZEIDX]); + Y_ASSERT_NOBT(sizeof(TFreeListGroup) == nSizeIdxToSize[FREE_LIST_GROUP_SIZEIDX]); if (!g) { g = (TFreeListGroup*)LFAllocNoCache(FREE_LIST_GROUP_SIZEIDX, NO_MEM_DEFRAG); } @@ -1123,7 +1123,7 @@ struct TThreadAllocInfo { GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hThread, 0, FALSE, DUPLICATE_SAME_ACCESS); - Y_ASSERT_NOBT(b); + Y_ASSERT_NOBT(b); #endif pNextInfo = *pHead; *pHead = this; @@ -1147,7 +1147,7 @@ struct TThreadAllocInfo { } void Done() { for (auto sizeIdx : FreePtrIndex) { - Y_ASSERT_NOBT(sizeIdx == THREAD_BUF); + Y_ASSERT_NOBT(sizeIdx == THREAD_BUF); } for (auto& localCounter : LocalCounters) { localCounter.Flush(); @@ -1418,7 +1418,7 @@ static inline void SampleDeallocation(TAllocHeader* p, int sizeIdx) { static inline void TrackPerTagAllocation(TAllocHeader* p, int sizeIdx) { if (p->Tag < DBG_ALLOC_MAX_TAG && p->Tag >= 0) { - Y_ASSERT_NOBT(sizeIdx < DBG_ALLOC_NUM_SIZES); + Y_ASSERT_NOBT(sizeIdx < DBG_ALLOC_NUM_SIZES); auto& global = GlobalPerTagAllocCounters[p->Tag][sizeIdx]; TThreadAllocInfo* thr = pThreadInfo; @@ -1433,7 +1433,7 @@ static inline void TrackPerTagAllocation(TAllocHeader* p, int sizeIdx) { static inline void TrackPerTagDeallocation(TAllocHeader* p, int sizeIdx) { if (p->Tag < DBG_ALLOC_MAX_TAG && p->Tag >= 0) { - Y_ASSERT_NOBT(sizeIdx < DBG_ALLOC_NUM_SIZES); + Y_ASSERT_NOBT(sizeIdx < DBG_ALLOC_NUM_SIZES); auto& global = GlobalPerTagAllocCounters[p->Tag][sizeIdx]; TThreadAllocInfo* thr = pThreadInfo; |