aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorkserz <kserz@yandex-team.ru>2022-02-10 16:51:47 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:51:47 +0300
commit0831cac87ab5748ed91187b7d1832aeebb854fc6 (patch)
treeab7fbbf3253d4c0e2793218f09378908beb025fb /util
parentc95a5c19764639f5d60ee32e82302cc0333b9735 (diff)
downloadydb-0831cac87ab5748ed91187b7d1832aeebb854fc6.tar.gz
Restoring authorship annotation for <kserz@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util')
-rw-r--r--util/generic/xrange.h8
-rw-r--r--util/system/filemap.cpp6
-rw-r--r--util/system/filemap.h4
-rw-r--r--util/system/filemap_ut.cpp34
4 files changed, 26 insertions, 26 deletions
diff --git a/util/generic/xrange.h b/util/generic/xrange.h
index fafdf83a73..5fc8c82912 100644
--- a/util/generic/xrange.h
+++ b/util/generic/xrange.h
@@ -91,10 +91,10 @@ namespace NPrivate {
return *this;
}
- constexpr bool operator<(const TIterator& b) const noexcept {
- return Value < b.Value;
- }
-
+ constexpr bool operator<(const TIterator& b) const noexcept {
+ return Value < b.Value;
+ }
+
private:
T Value;
};
diff --git a/util/system/filemap.cpp b/util/system/filemap.cpp
index 2cdfaff845..7454a4cb94 100644
--- a/util/system/filemap.cpp
+++ b/util/system/filemap.cpp
@@ -131,7 +131,7 @@ public:
Mapping_ = nullptr;
if (Length_) {
Mapping_ = CreateFileMapping(File_.GetHandle(), nullptr,
- (Mode_ & oAccessMask) == TFileMap::oRdWr ? PAGE_READWRITE : PAGE_READONLY,
+ (Mode_ & oAccessMask) == TFileMap::oRdWr ? PAGE_READWRITE : PAGE_READONLY,
(DWORD)(Length_ >> 32), (DWORD)(Length_ & 0xFFFFFFFF), nullptr);
if (Mapping_ == nullptr) {
ythrow yexception() << "Can't create file mapping of '" << DbgName_ << "': " << LastSystemErrorText();
@@ -215,7 +215,7 @@ public:
}
inline bool IsWritable() const noexcept {
- return (Mode_ & oRdWr || Mode_ & oCopyOnWr);
+ return (Mode_ & oRdWr || Mode_ & oCopyOnWr);
}
inline TMapResult Map(i64 offset, size_t size) {
@@ -236,7 +236,7 @@ public:
size += result.Head;
#if defined(_win_)
- result.Ptr = MapViewOfFile(Mapping_,
+ result.Ptr = MapViewOfFile(Mapping_,
(Mode_ & oAccessMask) == oRdOnly ? FILE_MAP_READ : (Mode_ & oAccessMask) == oCopyOnWr ? FILE_MAP_COPY
: FILE_MAP_WRITE,
Hi32(base), Lo32(base), size);
diff --git a/util/system/filemap.h b/util/system/filemap.h
index e0d801ba53..11be64bff4 100644
--- a/util/system/filemap.h
+++ b/util/system/filemap.h
@@ -51,9 +51,9 @@ struct TMemoryMapCommon {
enum EOpenModeFlag {
oRdOnly = 1,
oRdWr = 2,
- oCopyOnWr = 4,
+ oCopyOnWr = 4,
- oAccessMask = 7,
+ oAccessMask = 7,
oNotGreedy = 8,
oPrecharge = 16,
oPopulate = 32, // Populate page table entries (see mmap's MAP_POPULATE)
diff --git a/util/system/filemap_ut.cpp b/util/system/filemap_ut.cpp
index 24105ccda1..73f109dc88 100644
--- a/util/system/filemap_ut.cpp
+++ b/util/system/filemap_ut.cpp
@@ -62,7 +62,7 @@ Y_UNIT_TEST_SUITE(TFileMapTest) {
Y_UNIT_TEST(TestFileRemap) {
const char data1[] = "01234";
const char data2[] = "abcdefg";
- const char data3[] = "COPY";
+ const char data3[] = "COPY";
const char dataFinal[] = "012abcdefg";
const size_t data2Shift = 3;
@@ -73,27 +73,27 @@ Y_UNIT_TEST_SUITE(TFileMapTest) {
{
TFileMap mappedFile(FileName_, TMemoryMapCommon::oRdWr);
mappedFile.Map(0, mappedFile.Length());
- UNIT_ASSERT(mappedFile.MappedSize() == sizeof(data1) &&
- mappedFile.Length() == sizeof(data1));
+ UNIT_ASSERT(mappedFile.MappedSize() == sizeof(data1) &&
+ mappedFile.Length() == sizeof(data1));
mappedFile.ResizeAndRemap(data2Shift, sizeof(data2));
memcpy(mappedFile.Ptr(), data2, sizeof(data2));
}
- {
- TFileMap mappedFile(FileName_, TMemoryMapCommon::oCopyOnWr);
- mappedFile.Map(0, mappedFile.Length());
- UNIT_ASSERT(mappedFile.MappedSize() == sizeof(dataFinal) &&
- mappedFile.Length() == sizeof(dataFinal));
-
- char* data = static_cast<char*>(mappedFile.Ptr());
- UNIT_ASSERT(data[0] == '0');
- UNIT_ASSERT(data[3] == 'a');
- memcpy(data, data3, sizeof(data3));
- UNIT_ASSERT(data[0] == 'C');
- UNIT_ASSERT(data[3] == 'Y');
- }
-
+ {
+ TFileMap mappedFile(FileName_, TMemoryMapCommon::oCopyOnWr);
+ mappedFile.Map(0, mappedFile.Length());
+ UNIT_ASSERT(mappedFile.MappedSize() == sizeof(dataFinal) &&
+ mappedFile.Length() == sizeof(dataFinal));
+
+ char* data = static_cast<char*>(mappedFile.Ptr());
+ UNIT_ASSERT(data[0] == '0');
+ UNIT_ASSERT(data[3] == 'a');
+ memcpy(data, data3, sizeof(data3));
+ UNIT_ASSERT(data[0] == 'C');
+ UNIT_ASSERT(data[3] == 'Y');
+ }
+
TFile resFile(FileName_, RdOnly);
UNIT_ASSERT(resFile.GetLength() == sizeof(dataFinal));
char buf[sizeof(dataFinal)];