InternalProtected_ReadonlyidThe resource ID
Protected ReadonlyoptionsReadonlyregionsRegions used to reduce unneeded allocations. Think of sparse arrays.
The full size of the resource
Add new data to the cache at given specified offset
Get the cached sub-ranges of an initial range.
This is conceptually the inverse of missing.
Combines adjacent regions and combines adjacent ranges within a region
ProtectedcollectCombine the region at index with the neighbors it now reaches.
Only that region can have changed, so this does not re-walk the whole list the way collect does.
ProtectedindexIndex of the first region positioned after offset. Regions are kept sorted, so this is a binary search.
ProtectedmergeMerge the region after index into the one at index, if the gap between them is small enough
Takes an initial range and finds the sub-ranges that are not in the cache
The regions overlapping [start, end), in order. Seeks to the first one rather than scanning from the start.
ProtectedresizeResize region.data to length bytes.
Capacity can be over-allocated geometrically so appending to a region repeatedly stays amortized O(1).
The cache for a specific resource