aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/balloc
diff options
context:
space:
mode:
authorAlexey Salmin <alexey.salmin@gmail.com>2022-02-10 16:49:37 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:37 +0300
commit71af077a5dfe7e9f932a508422c2dac81a57ebc0 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/balloc
parent3c5b1607b38f637d2f3313791ed25c2e080d2647 (diff)
downloadydb-71af077a5dfe7e9f932a508422c2dac81a57ebc0.tar.gz
Restoring authorship annotation for Alexey Salmin <alexey.salmin@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/balloc')
-rw-r--r--library/cpp/balloc/balloc.cpp18
-rw-r--r--library/cpp/balloc/malloc-info.cpp12
-rw-r--r--library/cpp/balloc/optional/operators.h8
3 files changed, 19 insertions, 19 deletions
diff --git a/library/cpp/balloc/balloc.cpp b/library/cpp/balloc/balloc.cpp
index 1635a2fab8..fab489db4c 100644
--- a/library/cpp/balloc/balloc.cpp
+++ b/library/cpp/balloc/balloc.cpp
@@ -76,7 +76,7 @@ namespace NBalloc {
static void Y_FORCE_INLINE Enable() {
tls.Mode = ToBeEnabled;
}
-
+
static bool Y_FORCE_INLINE IsDisabled() {
return tls.Mode == Disabled;
}
@@ -273,11 +273,11 @@ extern "C" void* realloc(void* oldPtr, size_t newSize) {
}
#endif
-// Only for testing purposes. Never use in production.
+// Only for testing purposes. Never use in production.
extern "C" bool IsOwnedByBalloc(void* ptr) {
- return NBalloc::IsOwnedByBalloc(ptr);
-}
-
+ return NBalloc::IsOwnedByBalloc(ptr);
+}
+
extern "C" bool BallocDisabled() {
return NBalloc::IsDisabled();
}
@@ -286,10 +286,10 @@ extern "C" void DisableBalloc() {
NBalloc::Disable();
}
-extern "C" void EnableBalloc() {
- NBalloc::Enable();
-}
-
+extern "C" void EnableBalloc() {
+ NBalloc::Enable();
+}
+
extern "C" void* memalign(size_t alignment, size_t size) {
void* ptr;
int res = posix_memalign(&ptr, alignment, size);
diff --git a/library/cpp/balloc/malloc-info.cpp b/library/cpp/balloc/malloc-info.cpp
index 2fcebf7f81..604b1fb145 100644
--- a/library/cpp/balloc/malloc-info.cpp
+++ b/library/cpp/balloc/malloc-info.cpp
@@ -5,18 +5,18 @@
using namespace NMalloc;
extern "C" void DisableBalloc();
-extern "C" void EnableBalloc();
+extern "C" void EnableBalloc();
extern "C" bool BallocDisabled();
namespace {
bool SetAllocParam(const char* name, const char* value) {
if (strcmp(name, "disable") == 0) {
if (value == nullptr || strcmp(value, "false") != 0) {
- // all values other than "false" are considred to be "true" for compatibility
- DisableBalloc();
- } else {
- EnableBalloc();
- }
+ // all values other than "false" are considred to be "true" for compatibility
+ DisableBalloc();
+ } else {
+ EnableBalloc();
+ }
return true;
}
return false;
diff --git a/library/cpp/balloc/optional/operators.h b/library/cpp/balloc/optional/operators.h
index c4632089ea..6107d28a6e 100644
--- a/library/cpp/balloc/optional/operators.h
+++ b/library/cpp/balloc/optional/operators.h
@@ -10,7 +10,7 @@ inline bool BallocEnabled() {
inline void ThreadDisableBalloc() {
::NMalloc::MallocInfo().SetParam("disable", "true");
}
-
-inline void ThreadEnableBalloc() {
- ::NMalloc::MallocInfo().SetParam("disable", "false");
-}
+
+inline void ThreadEnableBalloc() {
+ ::NMalloc::MallocInfo().SetParam("disable", "false");
+}