You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$(H1 Thread-safe reference-counted arrays and pointers)
3
3
4
-
Publicly imports $(MREF mir,rc,array) and $(MREF mir,rc,ptr).
4
+
Mir provides two kinds of ref-counting pointers and two kinds of ref-counted arrays.
5
+
6
+
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.
7
+
The second kind is `SlimRCPtr`, which consist only from a pointer to the value. The context for `SlimRCPtr`is computed using a fixed-length memory shift from the pointer to the value.
8
+
`SlimRCPtr` can be converted to an `RCPtr` and to an `RCArray` of the one element.
9
+
10
+
`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.
11
+
`RCArray!T` can be converted or moved to `Slice!(RCI!(T))` using `.asSlice` or `.moveToSlice` methods respectively.
12
+
13
+
$(RED `RCArray!T` aliases itself to a common D array slice. This feature may cause a segmentation fault in safe code if used without DIP1000.)
14
+
15
+
`RCPtr!T` can be constructed from an element index and `RCArray!T` / `Slice!(RCI!(T))`.
16
+
17
+
The package publicly imports $(MREF mir,rc,array), $(MREF mir,rc,ptr), and $(MREF mir,rc,slim_ptr).
18
+
19
+
See_also: $(MREF mir,ndslice).
5
20
+/
6
21
modulemir.rc;
7
22
8
23
publicimport mir.rc.array;
9
24
publicimport mir.rc.ptr;
10
25
publicimport mir.rc.slim_ptr;
26
+
27
+
import mir.ndslice.slice;
28
+
29
+
/++
30
+
Returns: shared pointer constructed from the slim shared pointer.
0 commit comments