File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -161,12 +161,13 @@ impl<T: Marker> Hash for PointerId<T> {
161161
162162impl < T : StorageItem > From < & Arc < T > > for PointerId < T :: Marker > {
163163 fn from ( arc : & Arc < T > ) -> Self {
164- // Since the memory representation of `Arc<T>` is just a pointer, it
165- // would be nice to use that pointer as the trace ID, since many
166- // `into_trace` implementations would then be no-ops at runtime.
167- // Unfortunately, because `Arc::as_ptr` returns a pointer to the
168- // contained data, and `Arc` stores reference counts before the data,
169- // we are adding an offset to the pointer here.
164+ // Since the memory representation of `Arc<T>` is just a pointer to
165+ // `ArcInner<T>`, it would be nice to use that pointer as the trace ID,
166+ // since many `into_trace` implementations would then be no-ops at
167+ // runtime. However, `Arc::as_ptr` returns a pointer to the contained
168+ // data, not to the `ArcInner`. The `ArcInner` stores the reference
169+ // counts before the data, so the machine code for this conversion has
170+ // to add an offset to the pointer.
170171 PointerId :: PointerId ( Arc :: as_ptr ( arc) as usize , PhantomData )
171172 }
172173}
You can’t perform that action at this time.
0 commit comments