aboutsummaryrefslogtreecommitdiffstats
path: root/util/memory/blob.cpp
diff options
context:
space:
mode:
authorkalabukdima <kalabukdima@yandex-team.ru>2022-02-10 16:51:42 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:51:42 +0300
commitf455f8d9061f47bcb74f3f4e319a5a701dbae24f (patch)
treeab7fbbf3253d4c0e2793218f09378908beb025fb /util/memory/blob.cpp
parentb688e76378935ca7132292872a1dc37ba410e3ec (diff)
downloadydb-f455f8d9061f47bcb74f3f4e319a5a701dbae24f.tar.gz
Restoring authorship annotation for <kalabukdima@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/memory/blob.cpp')
-rw-r--r--util/memory/blob.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/util/memory/blob.cpp b/util/memory/blob.cpp
index 8650e2cfb0..91da5cadca 100644
--- a/util/memory/blob.cpp
+++ b/util/memory/blob.cpp
@@ -117,13 +117,13 @@ public:
ythrow yexception() << "can not map(" << offset << ", " << len << ")";
}
- if (Mode_ == EMappingMode::Locked) {
+ if (Mode_ == EMappingMode::Locked) {
LockMemory(Data(), Length());
}
}
~TMappedBlobBase() override {
- if (Mode_ == EMappingMode::Locked && Length()) {
+ if (Mode_ == EMappingMode::Locked && Length()) {
UnlockMemory(Data(), Length());
}
}
@@ -208,7 +208,7 @@ static inline TBlob ConstructFromMap(const TMemoryMap& map, ui64 offset, size_t
template <class TCounter, class T>
static inline TBlob ConstructAsMap(const T& t, EMappingMode mode) {
- TMemoryMap::EOpenMode openMode = (mode == EMappingMode::Precharged) ? (TMemoryMap::oRdOnly | TMemoryMap::oPrecharge) : TMemoryMap::oRdOnly;
+ TMemoryMap::EOpenMode openMode = (mode == EMappingMode::Precharged) ? (TMemoryMap::oRdOnly | TMemoryMap::oPrecharge) : TMemoryMap::oRdOnly;
TMemoryMap map(t, openMode);
const ui64 toMap = map.Length();
@@ -220,84 +220,84 @@ static inline TBlob ConstructAsMap(const T& t, EMappingMode mode) {
return ConstructFromMap<TCounter>(map, 0, static_cast<size_t>(toMap), mode);
}
-TBlob TBlob::FromFileSingleThreaded(const TString& path, EMappingMode mode) {
- return ConstructAsMap<TSimpleCounter>(path, mode);
-}
-
-TBlob TBlob::FromFile(const TString& path, EMappingMode mode) {
- return ConstructAsMap<TAtomicCounter>(path, mode);
-}
-
-TBlob TBlob::FromFileSingleThreaded(const TFile& file, EMappingMode mode) {
- return ConstructAsMap<TSimpleCounter>(file, mode);
-}
-
-TBlob TBlob::FromFile(const TFile& file, EMappingMode mode) {
- return ConstructAsMap<TAtomicCounter>(file, mode);
-}
-
+TBlob TBlob::FromFileSingleThreaded(const TString& path, EMappingMode mode) {
+ return ConstructAsMap<TSimpleCounter>(path, mode);
+}
+
+TBlob TBlob::FromFile(const TString& path, EMappingMode mode) {
+ return ConstructAsMap<TAtomicCounter>(path, mode);
+}
+
+TBlob TBlob::FromFileSingleThreaded(const TFile& file, EMappingMode mode) {
+ return ConstructAsMap<TSimpleCounter>(file, mode);
+}
+
+TBlob TBlob::FromFile(const TFile& file, EMappingMode mode) {
+ return ConstructAsMap<TAtomicCounter>(file, mode);
+}
+
TBlob TBlob::FromFileSingleThreaded(const TString& path) {
- return ConstructAsMap<TSimpleCounter>(path, EMappingMode::Standard);
+ return ConstructAsMap<TSimpleCounter>(path, EMappingMode::Standard);
}
TBlob TBlob::FromFile(const TString& path) {
- return ConstructAsMap<TAtomicCounter>(path, EMappingMode::Standard);
+ return ConstructAsMap<TAtomicCounter>(path, EMappingMode::Standard);
}
TBlob TBlob::FromFileSingleThreaded(const TFile& file) {
- return ConstructAsMap<TSimpleCounter>(file, EMappingMode::Standard);
+ return ConstructAsMap<TSimpleCounter>(file, EMappingMode::Standard);
}
TBlob TBlob::FromFile(const TFile& file) {
- return ConstructAsMap<TAtomicCounter>(file, EMappingMode::Standard);
+ return ConstructAsMap<TAtomicCounter>(file, EMappingMode::Standard);
}
TBlob TBlob::PrechargedFromFileSingleThreaded(const TString& path) {
- return ConstructAsMap<TSimpleCounter>(path, EMappingMode::Precharged);
+ return ConstructAsMap<TSimpleCounter>(path, EMappingMode::Precharged);
}
TBlob TBlob::PrechargedFromFile(const TString& path) {
- return ConstructAsMap<TAtomicCounter>(path, EMappingMode::Precharged);
+ return ConstructAsMap<TAtomicCounter>(path, EMappingMode::Precharged);
}
TBlob TBlob::PrechargedFromFileSingleThreaded(const TFile& file) {
- return ConstructAsMap<TSimpleCounter>(file, EMappingMode::Precharged);
+ return ConstructAsMap<TSimpleCounter>(file, EMappingMode::Precharged);
}
TBlob TBlob::PrechargedFromFile(const TFile& file) {
- return ConstructAsMap<TAtomicCounter>(file, EMappingMode::Precharged);
+ return ConstructAsMap<TAtomicCounter>(file, EMappingMode::Precharged);
}
TBlob TBlob::LockedFromFileSingleThreaded(const TString& path) {
- return ConstructAsMap<TSimpleCounter>(path, EMappingMode::Locked);
+ return ConstructAsMap<TSimpleCounter>(path, EMappingMode::Locked);
}
TBlob TBlob::LockedFromFile(const TString& path) {
- return ConstructAsMap<TAtomicCounter>(path, EMappingMode::Locked);
+ return ConstructAsMap<TAtomicCounter>(path, EMappingMode::Locked);
}
TBlob TBlob::LockedFromFileSingleThreaded(const TFile& file) {
- return ConstructAsMap<TSimpleCounter>(file, EMappingMode::Locked);
+ return ConstructAsMap<TSimpleCounter>(file, EMappingMode::Locked);
}
TBlob TBlob::LockedFromFile(const TFile& file) {
- return ConstructAsMap<TAtomicCounter>(file, EMappingMode::Locked);
+ return ConstructAsMap<TAtomicCounter>(file, EMappingMode::Locked);
}
TBlob TBlob::LockedFromMemoryMapSingleThreaded(const TMemoryMap& map, ui64 offset, size_t length) {
- return ConstructFromMap<TSimpleCounter>(map, offset, length, EMappingMode::Locked);
+ return ConstructFromMap<TSimpleCounter>(map, offset, length, EMappingMode::Locked);
}
TBlob TBlob::LockedFromMemoryMap(const TMemoryMap& map, ui64 offset, size_t length) {
- return ConstructFromMap<TAtomicCounter>(map, offset, length, EMappingMode::Locked);
+ return ConstructFromMap<TAtomicCounter>(map, offset, length, EMappingMode::Locked);
}
TBlob TBlob::FromMemoryMapSingleThreaded(const TMemoryMap& map, ui64 offset, size_t length) {
- return ConstructFromMap<TSimpleCounter>(map, offset, length, EMappingMode::Standard);
+ return ConstructFromMap<TSimpleCounter>(map, offset, length, EMappingMode::Standard);
}
TBlob TBlob::FromMemoryMap(const TMemoryMap& map, ui64 offset, size_t length) {
- return ConstructFromMap<TAtomicCounter>(map, offset, length, EMappingMode::Standard);
+ return ConstructFromMap<TAtomicCounter>(map, offset, length, EMappingMode::Standard);
}
template <class TCounter>