@@ -135,25 +135,25 @@ const SEGMENT_LOGSIZE: usize = 10;
135135
136136/// A fixed size array of atomic pointers to other `Segment<T>` or `T`.
137137///
138- /// Each segment is either a child segment with pointers to `Segment<T>` or an element segment with
139- /// pointers to `T`. This is determined by the height of this segment in the main array, which one
140- /// needs to track separately. For example, use the main array root's tag.
138+ /// Each segment is either an inner segment with pointers to other, children `Segment<T>` or an
139+ /// element segment with pointers to `T`. This is determined by the height of this segment in the
140+ /// main array, which one needs to track separately. For example, use the main array root's tag.
141141///
142- /// Since destructing segments requires its height information, it is not recommended to
143- /// implement [`Drop`]. Rather, implement and use the custom [`Segment::deallocate`] method that
144- /// accounts for the height of the segment.
142+ /// Since destructing segments requires its height information, it is not recommended to implement
143+ /// [`Drop`]. Rather, implement and use the custom [`Segment::deallocate`] method that accounts for
144+ /// the height of the segment.
145145union Segment < T > {
146146 children : ManuallyDrop < [ Atomic < Segment < T > > ; 1 << SEGMENT_LOGSIZE ] > ,
147147 elements : ManuallyDrop < [ Atomic < T > ; 1 << SEGMENT_LOGSIZE ] > ,
148148}
149149
150150impl < T > Segment < T > {
151151 /// Create a new segment filled with null pointers. It is up to the callee to whether to use
152- /// this as a children or an element segment.
152+ /// this as an intermediate or an element segment.
153153 fn new ( ) -> Owned < Self > {
154154 Owned :: new (
155- // SAFETY: An array of null pointers can be interperted as either an element segment or
156- // a children segment.
155+ // SAFETY: An array of null pointers can be interperted as either an intermediate
156+ // segment or an element segment.
157157 unsafe { mem:: zeroed ( ) } ,
158158 )
159159 }
@@ -162,7 +162,8 @@ impl<T> Segment<T> {
162162 ///
163163 /// # Safety
164164 ///
165- /// `self` must actually have height `height`.
165+ /// - `self` must actually have height `height`.
166+ /// - There should be no other references to possible children segments.
166167 unsafe fn deallocate ( self , height : usize ) {
167168 todo ! ( )
168169 }
@@ -197,7 +198,7 @@ impl<T> GrowableArray<T> {
197198
198199 /// Returns the reference to the `Atomic` pointer at `index`. Allocates new segments if
199200 /// necessary.
200- pub fn get < ' g > ( & self , mut index : usize , guard : & ' g Guard ) -> & ' g Atomic < T > {
201+ pub fn get < ' g > ( & self , index : usize , guard : & ' g Guard ) -> & ' g Atomic < T > {
201202 todo ! ( )
202203 }
203204}
0 commit comments