@@ -214,6 +214,7 @@ impl RefCounts {
214214///
215215/// - `value_ptr` must point to a value object (can be uninitialized or dropped) that lives in a
216216/// reference-counted allocation.
217+ #[ inline]
217218unsafe fn ref_counts_ptr_from_value_ptr ( value_ptr : NonNull < ( ) > ) -> NonNull < RefCounts > {
218219 // SAFETY: Caller guarantees `value_ptr` point to the value inside some reference counted, our
219220 // implementation guarantees the `RefCounts` object has offset of `size_of::<RefCounts>()` to
@@ -228,6 +229,7 @@ unsafe fn ref_counts_ptr_from_value_ptr(value_ptr: NonNull<()>) -> NonNull<RefCo
228229///
229230/// - `value_ptr` must point to a value object (can be uninitialized or dropped) that lives in a
230231/// reference-counted allocation.
232+ #[ inline]
231233unsafe fn strong_count_ptr_from_value_ptr ( value_ptr : NonNull < ( ) > ) -> NonNull < UnsafeCell < usize > > {
232234 let ref_counts_ptr = unsafe { ref_counts_ptr_from_value_ptr ( value_ptr) } ;
233235
@@ -241,6 +243,7 @@ unsafe fn strong_count_ptr_from_value_ptr(value_ptr: NonNull<()>) -> NonNull<Uns
241243///
242244/// - `value_ptr` must point to a value object (can be uninitialized or dropped) that lives in a
243245/// reference-counted allocation.
246+ #[ inline]
244247unsafe fn weak_count_ptr_from_value_ptr ( value_ptr : NonNull < ( ) > ) -> NonNull < UnsafeCell < usize > > {
245248 let ref_counts_ptr = unsafe { ref_counts_ptr_from_value_ptr ( value_ptr) } ;
246249
@@ -415,6 +418,7 @@ where
415418/// Allocates a reference-counted memory chunk for storing a value according to `rc_layout`, then
416419/// initialize the value with `f`. If `f` panics, the allocated memory will be deallocated.
417420#[ cfg( not( no_global_oom_handling) ) ]
421+ #[ inline]
418422fn allocate_with_in < A , F , const STRONG_COUNT : usize > (
419423 alloc : & A ,
420424 rc_layout : RcLayout ,
@@ -456,6 +460,7 @@ where
456460/// described by `rc_layout`. `f` will be called with a pointer that points the value storage to
457461/// initialize the allocated memory. If `f` panics, the allocated memory will be deallocated.
458462#[ cfg( not( no_global_oom_handling) ) ]
463+ #[ inline]
459464fn allocate_with < A , F , const STRONG_COUNT : usize > ( rc_layout : RcLayout , f : F ) -> ( NonNull < ( ) > , A )
460465where
461466 A : Allocator + Default ,
@@ -475,6 +480,7 @@ where
475480/// - Memory pointed to by `src_ptr` has enough data to read for filling the value in an allocation
476481/// that is described by `rc_layout`.
477482#[ cfg( not( no_global_oom_handling) ) ]
483+ #[ inline]
478484unsafe fn allocate_with_bytes_in < A , const STRONG_COUNT : usize > (
479485 src_ptr : NonNull < ( ) > ,
480486 alloc : & A ,
@@ -499,6 +505,7 @@ where
499505
500506/// Allocates a chunk of reference-counted memory with a value that is copied from `value`.
501507#[ cfg( not( no_global_oom_handling) ) ]
508+ #[ inline]
502509fn allocate_with_value_in < T , A , const STRONG_COUNT : usize > ( src : & T , alloc : & A ) -> NonNull < T >
503510where
504511 T : ?Sized ,
0 commit comments