[llvm-branch-commits] [CAS] Add MappedFileRegionBumpPtr (PR #114099)

Steven Wu via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Oct 29 10:37:31 PDT 2024


https://github.com/cachemeifyoucan created https://github.com/llvm/llvm-project/pull/114099

Add MappedFileRegionBumpPtr which can be served as a file system backed
persistent memory allocator. The allocator works like a BumpPtrAllocator,
and is designed to be thread safe and process safe.

The implementation relies on the POSIX compliance of file system and
doesn't work on all file systems. If the file system supports lazy tail
(doesn't allocate disk space if the tail of the large file is not used),
user has more flexibility to declare a larger capacity.

The allocator works by using a atomically updated bump ptr at a location
that can be customized by the user. The atomic pointer points to the
next available space to allocate, and the allocator will resize/truncate
to current usage once all clients closed the allocator.





More information about the llvm-branch-commits mailing list