MCPcopy Create free account
hub / github.com/catboost/catboost / Flush

Method Flush

util/system/filemap.cpp:477–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

475}
476
477void TFileMap::Flush(void* ptr, size_t size, bool sync) {
478 Y_ASSERT(ptr >= Ptr());
479 Y_ASSERT(static_cast<char*>(ptr) + size <= static_cast<char*>(Ptr()) + MappedSize());
480
481 if (!Region_.IsMapped()) {
482 return;
483 }
484
485#if defined(_win_)
486 if (sync) {
487 FlushViewOfFile(ptr, size);
488 }
489#else
490 msync(ptr, size, sync ? MS_SYNC : MS_ASYNC);
491#endif
492}
493
494TFileMap::TMapResult TFileMap::Map(i64 offset, size_t size) {
495 Unmap();

Callers

nothing calls this directly

Calls 1

IsMappedMethod · 0.80

Tested by

no test coverage detected