2 Commits

Author SHA1 Message Date
Steven Wu
9e9edb5834
[CAS] Fix build for older macOS SDK (before 13.0) (#159133)
Fix a build failure and back-deployment problem for macOS before 13.0.
2025-09-16 17:50:09 +00:00
Steven Wu
f9cd2ee119
[CAS] Add MappedFileRegionArena (#114099)
Add MappedFileRegionArena 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.

Windows implementation contributed by: @hjyamauchi
2025-09-15 10:00:21 -07:00