diff options
author | sereglond <sereglond@yandex-team.ru> | 2022-02-10 16:47:46 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:46 +0300 |
commit | eb3d925534734c808602b31b38b953677f0a279f (patch) | |
tree | 4222ef8dc375ee9f30b68a004ee42a0845e005b6 /util/system | |
parent | 4c8065245df3ea26b7757bcb1f8218df287f9148 (diff) | |
download | ydb-eb3d925534734c808602b31b38b953677f0a279f.tar.gz |
Restoring authorship annotation for <sereglond@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/system')
-rw-r--r-- | util/system/filemap.cpp | 30 | ||||
-rw-r--r-- | util/system/filemap.h | 2 |
2 files changed, 16 insertions, 16 deletions
diff --git a/util/system/filemap.cpp b/util/system/filemap.cpp index 7454a4cb94..8a30f115ed 100644 --- a/util/system/filemap.cpp +++ b/util/system/filemap.cpp @@ -102,28 +102,28 @@ static int ModeToMmapProt(TMemoryMapCommon::EOpenMode mode) { } #endif -// maybe we should move this function to another .cpp file to avoid unwanted optimization? +// maybe we should move this function to another .cpp file to avoid unwanted optimization? void NPrivate::Precharge(const void* data, size_t dataSize, size_t off, size_t size) { - if (off > dataSize) { - assert(false); + if (off > dataSize) { + assert(false); return; - } - size_t endOff = (size == (size_t)-1 ? dataSize : off + size); - if (endOff > dataSize) { - assert(false); - endOff = dataSize; - } - size = endOff - off; + } + size_t endOff = (size == (size_t)-1 ? dataSize : off + size); + if (endOff > dataSize) { + assert(false); + endOff = dataSize; + } + size = endOff - off; if (dataSize == 0 || size == 0) { return; } - + volatile const char *c = (const char*)data + off, *e = c + size; for (; c < e; c += 512) { *c; } -} - +} + class TMemoryMap::TImpl: public TAtomicRefCount<TImpl> { public: inline void CreateMapping() { @@ -527,8 +527,8 @@ TFileMap::~TFileMap() { void TFileMap::Precharge(size_t pos, size_t size) const { NPrivate::Precharge(Ptr(), MappedSize(), pos, size); -} - +} + TMappedAllocation::TMappedAllocation(size_t size, bool shared, void* addr) : Ptr_(nullptr) , Size_(0) diff --git a/util/system/filemap.h b/util/system/filemap.h index 11be64bff4..1de06fe415 100644 --- a/util/system/filemap.h +++ b/util/system/filemap.h @@ -167,7 +167,7 @@ public: } void Precharge(size_t pos = 0, size_t size = (size_t)-1) const; - + void SetSequential() { Map_.SetSequential(); } |