aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/balloc
diff options
context:
space:
mode:
authorjimmy <jimmy@yandex-team.ru>2022-02-10 16:49:38 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:38 +0300
commit5ab412f19b9312abbfa362391df45d6603bb84c3 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/balloc
parentaffdafdb1fc09bf0bfc384355143ee6db9e90046 (diff)
downloadydb-5ab412f19b9312abbfa362391df45d6603bb84c3.tar.gz
Restoring authorship annotation for <jimmy@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/balloc')
-rw-r--r--library/cpp/balloc/balloc.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/library/cpp/balloc/balloc.cpp b/library/cpp/balloc/balloc.cpp
index 2109ac4e35..fab489db4c 100644
--- a/library/cpp/balloc/balloc.cpp
+++ b/library/cpp/balloc/balloc.cpp
@@ -6,7 +6,7 @@ namespace NBalloc {
static constexpr size_t ALIVE_SIGNATURE = 0xaULL << 56;
static constexpr size_t DISABLED_SIGNATURE = 0xbULL << 56;
static constexpr size_t SIGNATURE_MASK = 0xfULL << 56;
-
+
static constexpr size_t MINIMAL_ALIGNMENT = sizeof(NBalloc::TAllocHeader);
static_assert(((MINIMAL_ALIGNMENT - 1) & MINIMAL_ALIGNMENT) == 0,
"invalid BALLOC_MINIMAL_ALIGNMENT");
@@ -63,7 +63,7 @@ namespace NBalloc {
}
NMalloc::AbortFromCorruptedAllocator();
Y_UNREACHABLE();
- }
+ }
static void Y_FORCE_INLINE Disable() {
#if defined(_musl_)
@@ -224,7 +224,7 @@ extern "C" void cfree(void* ptr) {
#if defined(Y_COVER_PTR)
free(ptr);
#else
- NBalloc::Free(ptr);
+ NBalloc::Free(ptr);
#endif
}
@@ -238,7 +238,7 @@ extern "C" void* realloc(void* oldPtr, size_t newSize) {
return result;
}
if (newSize == 0) {
- NBalloc::Free(oldPtr);
+ NBalloc::Free(oldPtr);
return nullptr;
}
void* newPtr = NBalloc::Malloc(newSize);
@@ -249,14 +249,14 @@ extern "C" void* realloc(void* oldPtr, size_t newSize) {
const size_t oldSize = header->AllocSize & ~NBalloc::SIGNATURE_MASK;
const size_t signature = header->AllocSize & NBalloc::SIGNATURE_MASK;
if (Y_LIKELY((signature == NBalloc::ALIVE_SIGNATURE) || (signature == NBalloc::DISABLED_SIGNATURE))) {
- memcpy(newPtr, oldPtr, oldSize < newSize ? oldSize : newSize);
- NBalloc::Free(oldPtr);
- return newPtr;
- }
+ memcpy(newPtr, oldPtr, oldSize < newSize ? oldSize : newSize);
+ NBalloc::Free(oldPtr);
+ return newPtr;
+ }
NMalloc::AbortFromCorruptedAllocator();
return nullptr;
}
-
+
#if defined(Y_COVER_PTR)
extern "C" void* realloc(void* oldPtr, size_t newSize) {
if (!oldPtr) {
@@ -282,9 +282,9 @@ extern "C" bool BallocDisabled() {
return NBalloc::IsDisabled();
}
-extern "C" void DisableBalloc() {
- NBalloc::Disable();
-}
+extern "C" void DisableBalloc() {
+ NBalloc::Disable();
+}
extern "C" void EnableBalloc() {
NBalloc::Enable();