aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/filemap.cpp
diff options
context:
space:
mode:
authorsereglond <sereglond@yandex-team.ru>2022-02-10 16:47:47 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:47 +0300
commit73bb02f2495181e0719a800f979df508924f4b71 (patch)
treec0748b5dcbade83af788c0abfa89c0383d6b779c /util/system/filemap.cpp
parenteb3d925534734c808602b31b38b953677f0a279f (diff)
downloadydb-73bb02f2495181e0719a800f979df508924f4b71.tar.gz
Restoring authorship annotation for <sereglond@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/system/filemap.cpp')
-rw-r--r--util/system/filemap.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/util/system/filemap.cpp b/util/system/filemap.cpp
index 8a30f115ed..7454a4cb94 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)