aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkalabukdima <kalabukdima@yandex-team.ru>2022-02-10 16:51:41 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:51:41 +0300
commitb688e76378935ca7132292872a1dc37ba410e3ec (patch)
treed633459d4077e98bb1a9908e6e406504e687fa17
parentd4833e6d53fab98fa55ca3aca3ac5adf038b2a61 (diff)
downloadydb-b688e76378935ca7132292872a1dc37ba410e3ec.tar.gz
Restoring authorship annotation for <kalabukdima@yandex-team.ru>. Commit 1 of 2.
-rw-r--r--build/prebuilt/tools/enum_parser/enum_parser/ya.make.resource6
-rw-r--r--util/memory/blob.cpp70
-rw-r--r--util/memory/blob.h42
3 files changed, 59 insertions, 59 deletions
diff --git a/build/prebuilt/tools/enum_parser/enum_parser/ya.make.resource b/build/prebuilt/tools/enum_parser/enum_parser/ya.make.resource
index f4ba3bbfae..657a169f48 100644
--- a/build/prebuilt/tools/enum_parser/enum_parser/ya.make.resource
+++ b/build/prebuilt/tools/enum_parser/enum_parser/ya.make.resource
@@ -1,9 +1,9 @@
IF (OS_DARWIN AND ARCH_X86_64)
- SET(SANDBOX_RESOURCE_ID 2265845868)
+ SET(SANDBOX_RESOURCE_ID 2265845868)
ELSEIF (OS_LINUX AND ARCH_X86_64)
- SET(SANDBOX_RESOURCE_ID 2265846387)
+ SET(SANDBOX_RESOURCE_ID 2265846387)
ELSEIF (OS_WINDOWS AND ARCH_X86_64)
- SET(SANDBOX_RESOURCE_ID 2265845307)
+ SET(SANDBOX_RESOURCE_ID 2265845307)
ELSE()
SET(SANDBOX_RESOURCE_ID)
ENDIF()
diff --git a/util/memory/blob.cpp b/util/memory/blob.cpp
index 91da5cadca..8650e2cfb0 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>
diff --git a/util/memory/blob.h b/util/memory/blob.h
index 20c02a68df..272925397c 100644
--- a/util/memory/blob.h
+++ b/util/memory/blob.h
@@ -10,15 +10,15 @@ class IInputStream;
class TFile;
class TBuffer;
-enum class EMappingMode {
- /// Just mmap a file allowing lazy page loading at access
- Standard,
- /// Same as previous but warmup the buffer with sequential access to it's data
- Precharged,
- /// Try to lock file in memory so that it doesn't wash away. See mlock(2)
- Locked
-};
-
+enum class EMappingMode {
+ /// Just mmap a file allowing lazy page loading at access
+ Standard,
+ /// Same as previous but warmup the buffer with sequential access to it's data
+ Precharged,
+ /// Try to lock file in memory so that it doesn't wash away. See mlock(2)
+ Locked
+};
+
/// @addtogroup BLOBs
/// @{
class TBlob {
@@ -201,18 +201,18 @@ public:
static TBlob NoCopy(const void* data, size_t length);
/// Creates a blob with a single-threaded (non atomic) refcounter. It maps the file on the path as data.
- static TBlob FromFileSingleThreaded(const TString& path, EMappingMode);
-
- /// Creates a blob with a multi-threaded (atomic) refcounter. It maps the file on the path as data.
- static TBlob FromFile(const TString& path, EMappingMode);
-
- /// Creates a blob with a single-threaded (non atomic) refcounter. It maps the file on the path as data.
- static TBlob FromFileSingleThreaded(const TFile& file, EMappingMode);
-
- /// Creates a blob with a multi-threaded (atomic) refcounter. It maps the file on the path as data.
- static TBlob FromFile(const TFile& file, EMappingMode);
-
- /// Creates a blob with a single-threaded (non atomic) refcounter. It maps the file on the path as data.
+ static TBlob FromFileSingleThreaded(const TString& path, EMappingMode);
+
+ /// Creates a blob with a multi-threaded (atomic) refcounter. It maps the file on the path as data.
+ static TBlob FromFile(const TString& path, EMappingMode);
+
+ /// Creates a blob with a single-threaded (non atomic) refcounter. It maps the file on the path as data.
+ static TBlob FromFileSingleThreaded(const TFile& file, EMappingMode);
+
+ /// Creates a blob with a multi-threaded (atomic) refcounter. It maps the file on the path as data.
+ static TBlob FromFile(const TFile& file, EMappingMode);
+
+ /// Creates a blob with a single-threaded (non atomic) refcounter. It maps the file on the path as data.
static TBlob FromFileSingleThreaded(const TString& path);
/// Creates a blob with a multi-threaded (atomic) refcounter. It maps the file on the path as data.