@@ -214,6 +214,7 @@ impl RefCounts {
214
214
///
215
215
/// - `value_ptr` must point to a value object (can be uninitialized or dropped) that lives in a
216
216
/// reference-counted allocation.
217
+ #[ inline]
217
218
unsafe fn ref_counts_ptr_from_value_ptr ( value_ptr : NonNull < ( ) > ) -> NonNull < RefCounts > {
218
219
// SAFETY: Caller guarantees `value_ptr` point to the value inside some reference counted, our
219
220
// 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
228
229
///
229
230
/// - `value_ptr` must point to a value object (can be uninitialized or dropped) that lives in a
230
231
/// reference-counted allocation.
232
+ #[ inline]
231
233
unsafe fn strong_count_ptr_from_value_ptr ( value_ptr : NonNull < ( ) > ) -> NonNull < UnsafeCell < usize > > {
232
234
let ref_counts_ptr = unsafe { ref_counts_ptr_from_value_ptr ( value_ptr) } ;
233
235
@@ -241,6 +243,7 @@ unsafe fn strong_count_ptr_from_value_ptr(value_ptr: NonNull<()>) -> NonNull<Uns
241
243
///
242
244
/// - `value_ptr` must point to a value object (can be uninitialized or dropped) that lives in a
243
245
/// reference-counted allocation.
246
+ #[ inline]
244
247
unsafe fn weak_count_ptr_from_value_ptr ( value_ptr : NonNull < ( ) > ) -> NonNull < UnsafeCell < usize > > {
245
248
let ref_counts_ptr = unsafe { ref_counts_ptr_from_value_ptr ( value_ptr) } ;
246
249
@@ -415,6 +418,7 @@ where
415
418
/// Allocates a reference-counted memory chunk for storing a value according to `rc_layout`, then
416
419
/// initialize the value with `f`. If `f` panics, the allocated memory will be deallocated.
417
420
#[ cfg( not( no_global_oom_handling) ) ]
421
+ #[ inline]
418
422
fn allocate_with_in < A , F , const STRONG_COUNT : usize > (
419
423
alloc : & A ,
420
424
rc_layout : RcLayout ,
@@ -456,6 +460,7 @@ where
456
460
/// described by `rc_layout`. `f` will be called with a pointer that points the value storage to
457
461
/// initialize the allocated memory. If `f` panics, the allocated memory will be deallocated.
458
462
#[ cfg( not( no_global_oom_handling) ) ]
463
+ #[ inline]
459
464
fn allocate_with < A , F , const STRONG_COUNT : usize > ( rc_layout : RcLayout , f : F ) -> ( NonNull < ( ) > , A )
460
465
where
461
466
A : Allocator + Default ,
@@ -475,6 +480,7 @@ where
475
480
/// - Memory pointed to by `src_ptr` has enough data to read for filling the value in an allocation
476
481
/// that is described by `rc_layout`.
477
482
#[ cfg( not( no_global_oom_handling) ) ]
483
+ #[ inline]
478
484
unsafe fn allocate_with_bytes_in < A , const STRONG_COUNT : usize > (
479
485
src_ptr : NonNull < ( ) > ,
480
486
alloc : & A ,
@@ -499,6 +505,7 @@ where
499
505
500
506
/// Allocates a chunk of reference-counted memory with a value that is copied from `value`.
501
507
#[ cfg( not( no_global_oom_handling) ) ]
508
+ #[ inline]
502
509
fn allocate_with_value_in < T , A , const STRONG_COUNT : usize > ( src : & T , alloc : & A ) -> NonNull < T >
503
510
where
504
511
T : ?Sized ,
0 commit comments