Skip to content

Various `KSharedDataCache` improvements

Dāvis Mosāns requested to merge davism/kcoreaddons:improve into master

This MR contains various KSharedDataCache improvements:

  • Do ensureFileAllocated() first before file.resize() - Otherwise if we fail to allocate file fully it will still stay as expected size and cause issues later since those sections won't be actually present on disk.
  • Refactor KSharedDataCache::Private
  • Allow KSDCCorrupted to output custom error message
  • KSDCMapping.mapSharedMemory: mlock mmap'ed file to verify that it's actually readable
  • KSDCMapping: Use MAP_SHARED even for anonymous fallback

Theses changes were extracted from !272 (closed)

And also it depends on !299 (merged) so I have included those commits here but once that's merged this can be rebased.

Merge request reports

Loading