aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/deprecated/mapped_file
diff options
context:
space:
mode:
authormelkov <melkov@yandex-team.ru>2022-02-10 16:48:14 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:14 +0300
commit2c532b38e6aeb4fd88531027c7335690fd34c4e5 (patch)
treeb222e5ac2e2e98872661c51ccceee5da0d291e13 /library/cpp/deprecated/mapped_file
parent438546c8737d5c1fdeb31157dcf999717d930eec (diff)
downloadydb-2c532b38e6aeb4fd88531027c7335690fd34c4e5.tar.gz
Restoring authorship annotation for <melkov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/deprecated/mapped_file')
-rw-r--r--library/cpp/deprecated/mapped_file/mapped_file.cpp4
-rw-r--r--library/cpp/deprecated/mapped_file/mapped_file.h10
2 files changed, 7 insertions, 7 deletions
diff --git a/library/cpp/deprecated/mapped_file/mapped_file.cpp b/library/cpp/deprecated/mapped_file/mapped_file.cpp
index 10032d8aab0..b0e4511299b 100644
--- a/library/cpp/deprecated/mapped_file/mapped_file.cpp
+++ b/library/cpp/deprecated/mapped_file/mapped_file.cpp
@@ -25,8 +25,8 @@ void TMappedFile::precharge(size_t off, size_t size) const {
return;
Map_->Precharge(off, size);
-}
-
+}
+
void TMappedFile::init(const TString& name) {
THolder<TFileMap> map(new TFileMap(name));
TMappedFile newFile(map.Get(), name.data());
diff --git a/library/cpp/deprecated/mapped_file/mapped_file.h b/library/cpp/deprecated/mapped_file/mapped_file.h
index 32bd169c57e..45859ed65a0 100644
--- a/library/cpp/deprecated/mapped_file/mapped_file.h
+++ b/library/cpp/deprecated/mapped_file/mapped_file.h
@@ -25,11 +25,11 @@ public:
TMappedFile() {
Map_ = nullptr;
}
-
+
~TMappedFile() {
term();
}
-
+
explicit TMappedFile(const TString& name) {
Map_ = nullptr;
init(name, TFileMap::oRdOnly);
@@ -54,16 +54,16 @@ public:
Map_ = nullptr;
}
}
-
+
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;
void swap(TMappedFile& file) noexcept {