diff options
author | somov <[email protected]> | 2022-02-10 16:45:49 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:45:49 +0300 |
commit | 7489e4682331202b9c7d863c0898eb83d7b12c2b (patch) | |
tree | 9142afc54d335ea52910662635b898e79e192e49 /library/cpp/deprecated/mapped_file/mapped_file.cpp | |
parent | a5950576e397b1909261050b8c7da16db58f10b1 (diff) |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/deprecated/mapped_file/mapped_file.cpp')
-rw-r--r-- | library/cpp/deprecated/mapped_file/mapped_file.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/library/cpp/deprecated/mapped_file/mapped_file.cpp b/library/cpp/deprecated/mapped_file/mapped_file.cpp index 02dbe5d62e8..b0e4511299b 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() { |