aboutsummaryrefslogtreecommitdiffstats
path: root/util/system
diff options
context:
space:
mode:
authorMikhail Borisov <borisov.mikhail@gmail.com>2022-02-10 16:45:39 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:39 +0300
commita6a92afe03e02795227d2641b49819b687f088f8 (patch)
treef6984a1d27d5a7ec88a6fdd6e20cd5b7693b6ece /util/system
parentc6dc8b8bd530985bc4cce0137e9a5de32f1087cb (diff)
downloadydb-a6a92afe03e02795227d2641b49819b687f088f8.tar.gz
Restoring authorship annotation for Mikhail Borisov <borisov.mikhail@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'util/system')
-rw-r--r--util/system/benchmark/cpu_id/metrics/main.py2
-rw-r--r--util/system/benchmark/create_destroy_thread/metrics/main.py6
-rw-r--r--util/system/sanitizers.h28
-rw-r--r--util/system/sanitizers_ut.cpp22
-rw-r--r--util/system/types.pxd26
-rw-r--r--util/system/types_ut.pyx80
-rw-r--r--util/system/ut/ya.make2
7 files changed, 83 insertions, 83 deletions
diff --git a/util/system/benchmark/cpu_id/metrics/main.py b/util/system/benchmark/cpu_id/metrics/main.py
index d9a86e825c..5b814f6f43 100644
--- a/util/system/benchmark/cpu_id/metrics/main.py
+++ b/util/system/benchmark/cpu_id/metrics/main.py
@@ -2,4 +2,4 @@ import yatest.common as yc
def test_export_metrics(metrics):
- metrics.set_benchmark(yc.execute_benchmark('util/system/benchmark/cpu_id/cpu_id', threads=8))
+ metrics.set_benchmark(yc.execute_benchmark('util/system/benchmark/cpu_id/cpu_id', threads=8))
diff --git a/util/system/benchmark/create_destroy_thread/metrics/main.py b/util/system/benchmark/create_destroy_thread/metrics/main.py
index 45564cda7f..38a40a448f 100644
--- a/util/system/benchmark/create_destroy_thread/metrics/main.py
+++ b/util/system/benchmark/create_destroy_thread/metrics/main.py
@@ -2,6 +2,6 @@ import yatest.common as yc
def test_export_metrics(metrics):
- metrics.set_benchmark(
- yc.execute_benchmark('util/system/benchmark/create_destroy_thread/create_destroy_thread', threads=8)
- )
+ metrics.set_benchmark(
+ yc.execute_benchmark('util/system/benchmark/create_destroy_thread/create_destroy_thread', threads=8)
+ )
diff --git a/util/system/sanitizers.h b/util/system/sanitizers.h
index 965e5c751e..0a08b7e24b 100644
--- a/util/system/sanitizers.h
+++ b/util/system/sanitizers.h
@@ -4,10 +4,10 @@
extern "C" { // sanitizers API
-#if defined(_asan_enabled_)
+#if defined(_asan_enabled_)
void __lsan_ignore_object(const void* p);
-#endif
-
+#endif
+
#if defined(_msan_enabled_)
void __msan_unpoison(const volatile void* a, size_t size);
void __msan_poison(const volatile void* a, size_t size);
@@ -82,7 +82,7 @@ namespace NSan {
}
// Make memory region fully initialized (without changing its contents).
- inline static void Unpoison(const volatile void* a, size_t size) noexcept {
+ inline static void Unpoison(const volatile void* a, size_t size) noexcept {
#if defined(_msan_enabled_)
__msan_unpoison(a, size);
#else
@@ -93,7 +93,7 @@ namespace NSan {
// Make memory region fully uninitialized (without changing its contents).
// This is a legacy interface that does not update origin information. Use __msan_allocated_memory() instead.
- inline static void Poison(const volatile void* a, size_t size) noexcept {
+ inline static void Poison(const volatile void* a, size_t size) noexcept {
#if defined(_msan_enabled_)
__msan_poison(a, size);
#else
@@ -103,7 +103,7 @@ namespace NSan {
}
// Checks that memory range is fully initialized, and reports an error if it is not.
- inline static void CheckMemIsInitialized(const volatile void* a, size_t size) noexcept {
+ inline static void CheckMemIsInitialized(const volatile void* a, size_t size) noexcept {
#if defined(_msan_enabled_)
__msan_check_mem_is_initialized(a, size);
#else
@@ -111,14 +111,14 @@ namespace NSan {
Y_UNUSED(size);
#endif
}
-
- inline static void MarkAsIntentionallyLeaked(const void* ptr) noexcept {
-#if defined(_asan_enabled_)
- __lsan_ignore_object(ptr);
-#else
- Y_UNUSED(ptr);
-#endif
- }
+
+ inline static void MarkAsIntentionallyLeaked(const void* ptr) noexcept {
+#if defined(_asan_enabled_)
+ __lsan_ignore_object(ptr);
+#else
+ Y_UNUSED(ptr);
+#endif
+ }
#if defined(_tsan_enabled_)
// defined in .cpp to avoid exposing problematic C-linkage version of AnnotateBenignRaceSized(...)
diff --git a/util/system/sanitizers_ut.cpp b/util/system/sanitizers_ut.cpp
index 5de096e14b..a27e171e45 100644
--- a/util/system/sanitizers_ut.cpp
+++ b/util/system/sanitizers_ut.cpp
@@ -1,15 +1,15 @@
-#include "sanitizers.h"
-#include "sys_alloc.h"
-
+#include "sanitizers.h"
+#include "sys_alloc.h"
+
#include <library/cpp/testing/unittest/registar.h>
-
+
Y_UNIT_TEST_SUITE(Sanitizers) {
Y_UNIT_TEST(MarkAsIntentionallyLeaked) {
- auto* p1 = new i32[100];
- NSan::MarkAsIntentionallyLeaked(p1);
-
- auto* p2 = y_allocate(123);
- NSan::MarkAsIntentionallyLeaked(p2);
- }
-
+ auto* p1 = new i32[100];
+ NSan::MarkAsIntentionallyLeaked(p1);
+
+ auto* p2 = y_allocate(123);
+ NSan::MarkAsIntentionallyLeaked(p2);
+ }
+
} // Y_UNIT_TEST_SUITE(Sanitizers)
diff --git a/util/system/types.pxd b/util/system/types.pxd
index cc916f6e70..bee758348d 100644
--- a/util/system/types.pxd
+++ b/util/system/types.pxd
@@ -1,13 +1,13 @@
-from libc.stdint cimport int8_t, int16_t, int32_t, int64_t
-from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t
-
-cdef extern from "<util/system/types.h>" nogil:
- ctypedef int8_t i8
- ctypedef int16_t i16
- ctypedef int32_t i32
- ctypedef int64_t i64
-
- ctypedef uint8_t ui8
- ctypedef uint16_t ui16
- ctypedef uint32_t ui32
- ctypedef uint64_t ui64
+from libc.stdint cimport int8_t, int16_t, int32_t, int64_t
+from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t
+
+cdef extern from "<util/system/types.h>" nogil:
+ ctypedef int8_t i8
+ ctypedef int16_t i16
+ ctypedef int32_t i32
+ ctypedef int64_t i64
+
+ ctypedef uint8_t ui8
+ ctypedef uint16_t ui16
+ ctypedef uint32_t ui32
+ ctypedef uint64_t ui64
diff --git a/util/system/types_ut.pyx b/util/system/types_ut.pyx
index bb93ac8566..a63f3ce0b0 100644
--- a/util/system/types_ut.pyx
+++ b/util/system/types_ut.pyx
@@ -1,40 +1,40 @@
-from util.system.types cimport i8, i16, i32, i64
-from util.system.types cimport ui8, ui16, ui32, ui64
-
-import pytest
-import unittest
-
-
-class TestTypes(unittest.TestCase):
- def test_i8(self):
- cdef i8 value = 42
- self.assertEqual(sizeof(value), 1)
-
- def test_ui8(self):
- cdef ui8 value = 42
- self.assertEqual(sizeof(value), 1)
-
- def test_i16(self):
- cdef i16 value = 42
- self.assertEqual(sizeof(value), 2)
-
- def test_ui16(self):
- cdef ui16 value = 42
- self.assertEqual(sizeof(value), 2)
-
- def test_i32(self):
- cdef i32 value = 42
- self.assertEqual(sizeof(value), 4)
-
- def test_ui32(self):
- cdef ui32 value = 42
- self.assertEqual(sizeof(value), 4)
-
- def test_i64(self):
- cdef i64 value = 42
- self.assertEqual(sizeof(value), 8)
-
- def test_ui64(self):
- cdef ui64 value = 42
- self.assertEqual(sizeof(value), 8)
-
+from util.system.types cimport i8, i16, i32, i64
+from util.system.types cimport ui8, ui16, ui32, ui64
+
+import pytest
+import unittest
+
+
+class TestTypes(unittest.TestCase):
+ def test_i8(self):
+ cdef i8 value = 42
+ self.assertEqual(sizeof(value), 1)
+
+ def test_ui8(self):
+ cdef ui8 value = 42
+ self.assertEqual(sizeof(value), 1)
+
+ def test_i16(self):
+ cdef i16 value = 42
+ self.assertEqual(sizeof(value), 2)
+
+ def test_ui16(self):
+ cdef ui16 value = 42
+ self.assertEqual(sizeof(value), 2)
+
+ def test_i32(self):
+ cdef i32 value = 42
+ self.assertEqual(sizeof(value), 4)
+
+ def test_ui32(self):
+ cdef ui32 value = 42
+ self.assertEqual(sizeof(value), 4)
+
+ def test_i64(self):
+ cdef i64 value = 42
+ self.assertEqual(sizeof(value), 8)
+
+ def test_ui64(self):
+ cdef ui64 value = 42
+ self.assertEqual(sizeof(value), 8)
+
diff --git a/util/system/ut/ya.make b/util/system/ut/ya.make
index 127e7c261e..ce6c3e811d 100644
--- a/util/system/ut/ya.make
+++ b/util/system/ut/ya.make
@@ -61,7 +61,7 @@ SRCS(
system/progname_ut.cpp
system/rusage_ut.cpp
system/rwlock_ut.cpp
- system/sanitizers_ut.cpp
+ system/sanitizers_ut.cpp
system/shellcommand_ut.cpp
system/spinlock_ut.cpp
system/src_root_ut.cpp