aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/deprecated
diff options
context:
space:
mode:
authorsomov <somov@yandex-team.ru>2022-02-10 16:45:49 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:49 +0300
commit7489e4682331202b9c7d863c0898eb83d7b12c2b (patch)
tree9142afc54d335ea52910662635b898e79e192e49 /library/cpp/deprecated
parenta5950576e397b1909261050b8c7da16db58f10b1 (diff)
downloadydb-7489e4682331202b9c7d863c0898eb83d7b12c2b.tar.gz
Restoring authorship annotation for <somov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/deprecated')
-rw-r--r--library/cpp/deprecated/mapped_file/mapped_file.cpp26
-rw-r--r--library/cpp/deprecated/mapped_file/mapped_file.h12
2 files changed, 19 insertions, 19 deletions
diff --git a/library/cpp/deprecated/mapped_file/mapped_file.cpp b/library/cpp/deprecated/mapped_file/mapped_file.cpp
index 02dbe5d62e..b0e4511299 100644
--- a/library/cpp/deprecated/mapped_file/mapped_file.cpp
+++ b/library/cpp/deprecated/mapped_file/mapped_file.cpp
@@ -10,16 +10,16 @@ TMappedFile::TMappedFile(TFileMap* map, const char* dbgName) {
i64 len = Map_->Length();
if (Hi32(len) != 0 && sizeof(size_t) <= sizeof(ui32))
ythrow yexception() << "File '" << dbgName << "' mapping error: " << len << " too large";
-
+
Map_->Map(0, static_cast<size_t>(len));
-}
-
+}
+
TMappedFile::TMappedFile(const TFile& file, TFileMap::EOpenMode om, const char* dbgName)
: Map_(nullptr)
-{
+{
init(file, om, dbgName);
-}
-
+}
+
void TMappedFile::precharge(size_t off, size_t size) const {
if (!Map_)
return;
@@ -39,24 +39,24 @@ void TMappedFile::init(const TString& name, size_t length, TFileMap::EOpenMode o
THolder<TFileMap> map(new TFileMap(name, length, om));
TMappedFile newFile(map.Get(), name.data());
Y_UNUSED(map.Release());
- newFile.swap(*this);
- newFile.term();
-}
+ newFile.swap(*this);
+ newFile.term();
+}
void TMappedFile::init(const TFile& file, TFileMap::EOpenMode om, const char* dbgName) {
THolder<TFileMap> map(new TFileMap(file, om));
TMappedFile newFile(map.Get(), dbgName);
Y_UNUSED(map.Release());
- newFile.swap(*this);
- newFile.term();
+ newFile.swap(*this);
+ newFile.term();
}
void TMappedFile::init(const TString& name, TFileMap::EOpenMode om) {
THolder<TFileMap> map(new TFileMap(name, om));
TMappedFile newFile(map.Get(), name.data());
Y_UNUSED(map.Release());
- newFile.swap(*this);
- newFile.term();
+ newFile.swap(*this);
+ newFile.term();
}
void TMappedFile::flush() {
diff --git a/library/cpp/deprecated/mapped_file/mapped_file.h b/library/cpp/deprecated/mapped_file/mapped_file.h
index 93fd9cf000..45859ed65a 100644
--- a/library/cpp/deprecated/mapped_file/mapped_file.h
+++ b/library/cpp/deprecated/mapped_file/mapped_file.h
@@ -18,9 +18,9 @@ class TMappedFile {
private:
TFileMap* Map_;
-private:
+private:
TMappedFile(TFileMap* map, const char* dbgName);
-
+
public:
TMappedFile() {
Map_ = nullptr;
@@ -36,11 +36,11 @@ public:
}
TMappedFile(const TFile& file, TFileMap::EOpenMode om = TFileMap::oRdOnly, const char* dbgName = "unknown");
-
+
void init(const TString& name);
void init(const TString& name, TFileMap::EOpenMode om);
-
+
void init(const TString& name, size_t length, TFileMap::EOpenMode om);
void init(const TFile&, TFileMap::EOpenMode om = TFileMap::oRdOnly, const char* dbgName = "unknown");
@@ -65,8 +65,8 @@ public:
}
void precharge(size_t pos = 0, size_t size = (size_t)-1) const;
-
+
void swap(TMappedFile& file) noexcept {
DoSwap(Map_, file.Map_);
- }
+ }
};