Mir provides two kinds of ref-counting pointers and two kinds of ref-counted arrays.
The first kind pointer is RCPtr, which consists of a pointer to the context and pointer to the value.RCPtr supports structural and object polymorphism. It allows getting members with the same context as the root.
The second kind is SlimRCPtr, which consist only from a pointer to the value. The context for SlimRCPtris computed using a fixed-length memory shift from the pointer to the value.
SlimRCPtr can be converted to an RCPtr and to an RCArray of the one element.
RCArray is an array type without range primitives. It's length can't be reduced after construction.In the other hand, Slice!(RCI!(T)) is an ndslice with all random-access range primitives.RCI is an iterator, which consists of RCArray and the pointer to the current element.
RCArray!T can be converted or moved to Slice!(RCI!(T)) using .asSlice or .moveToSlice methods respectively.
RCArray!T aliases itself to a common D array slice. This feature may cause a segmentation fault in safe code if used without DIP1000.
RCPtr!T can be constructed from an element index and RCArray!T / Slice!(RCI!(T)).
Thread-safe reference-counted arrays and pointers
Mir provides two kinds of ref-counting pointers and two kinds of ref-counted arrays.
The first kind pointer is RCPtr, which consists of a pointer to the context and pointer to the value.RCPtr supports structural and object polymorphism. It allows getting members with the same context as the root. The second kind is SlimRCPtr, which consist only from a pointer to the value. The context for SlimRCPtris computed using a fixed-length memory shift from the pointer to the value. SlimRCPtr can be converted to an RCPtr and to an RCArray of the one element.
RCArray is an array type without range primitives. It's length can't be reduced after construction.In the other hand, Slice!(RCI!(T)) is an ndslice with all random-access range primitives.RCI is an iterator, which consists of RCArray and the pointer to the current element. RCArray!T can be converted or moved to Slice!(RCI!(T)) using .asSlice or .moveToSlice methods respectively.
RCArray!T aliases itself to a common D array slice. This feature may cause a segmentation fault in safe code if used without DIP1000.
RCPtr!T can be constructed from an element index and RCArray!T / Slice!(RCI!(T)).
The package publicly imports mir.rc.array, mir.rc.ptr, and mir.rc.slim_ptr.