aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/deprecated/mapped_file
diff options
context:
space:
mode:
authordenplusplus <denplusplus@yandex-team.ru>2022-02-10 16:47:34 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:34 +0300
commit57c20d143e8a438cd76b9fdc3ca2e8ee3ac1f32a (patch)
treecc63639f8e502db19a82c20e2861c6d1edbf9fea /library/cpp/deprecated/mapped_file
parent464ba3814a83db4f2d5327393b0b6eaf0c86bfd7 (diff)
downloadydb-57c20d143e8a438cd76b9fdc3ca2e8ee3ac1f32a.tar.gz
Restoring authorship annotation for <denplusplus@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/deprecated/mapped_file')
-rw-r--r--library/cpp/deprecated/mapped_file/mapped_file.cpp8
-rw-r--r--library/cpp/deprecated/mapped_file/mapped_file.h16
2 files changed, 12 insertions, 12 deletions
diff --git a/library/cpp/deprecated/mapped_file/mapped_file.cpp b/library/cpp/deprecated/mapped_file/mapped_file.cpp
index b0e4511299b..6e72eef5c46 100644
--- a/library/cpp/deprecated/mapped_file/mapped_file.cpp
+++ b/library/cpp/deprecated/mapped_file/mapped_file.cpp
@@ -42,15 +42,15 @@ void TMappedFile::init(const TString& name, size_t length, TFileMap::EOpenMode o
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();
-}
-
+}
+
void TMappedFile::init(const TString& name, TFileMap::EOpenMode om) {
THolder<TFileMap> map(new TFileMap(name, om));
TMappedFile newFile(map.Get(), name.data());
@@ -61,4 +61,4 @@ void TMappedFile::init(const TString& name, TFileMap::EOpenMode om) {
void TMappedFile::flush() {
Map_->Flush();
-}
+}
diff --git a/library/cpp/deprecated/mapped_file/mapped_file.h b/library/cpp/deprecated/mapped_file/mapped_file.h
index 45859ed65a0..9edd84672ab 100644
--- a/library/cpp/deprecated/mapped_file/mapped_file.h
+++ b/library/cpp/deprecated/mapped_file/mapped_file.h
@@ -17,7 +17,7 @@
class TMappedFile {
private:
TFileMap* Map_;
-
+
private:
TMappedFile(TFileMap* map, const char* dbgName);
@@ -34,19 +34,19 @@ public:
Map_ = nullptr;
init(name, TFileMap::oRdOnly);
}
-
+
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");
- void flush();
-
+ void flush();
+
void term() {
if (Map_) {
Map_->Unmap();
@@ -57,12 +57,12 @@ public:
size_t getSize() const {
return (Map_ ? Map_->MappedSize() : 0);
- }
+ }
void* getData(size_t pos = 0) const {
Y_ASSERT(!Map_ || (pos <= getSize()));
return (Map_ ? (void*)((unsigned char*)Map_->Ptr() + pos) : nullptr);
- }
+ }
void precharge(size_t pos = 0, size_t size = (size_t)-1) const;