@@ -335,7 +335,7 @@ impl<T> Arc<T> {
335
335
#[ unstable( feature = "new_uninit" , issue = "63291" ) ]
336
336
pub fn new_uninit ( ) -> Arc < mem:: MaybeUninit < T > > {
337
337
unsafe {
338
- Arc :: from_ptr ( Arc :: allocate_for_unsized (
338
+ Arc :: from_ptr ( Arc :: allocate_for_layout (
339
339
Layout :: new :: < T > ( ) ,
340
340
|mem| mem as * mut ArcInner < mem:: MaybeUninit < T > > ,
341
341
) )
@@ -736,11 +736,11 @@ impl<T: ?Sized> Arc<T> {
736
736
737
737
impl < T : ?Sized > Arc < T > {
738
738
/// Allocates an `ArcInner<T>` with sufficient space for
739
- /// an unsized value where the value has the layout provided.
739
+ /// a possibly- unsized value where the value has the layout provided.
740
740
///
741
741
/// The function `mem_to_arcinner` is called with the data pointer
742
742
/// and must return back a (potentially fat)-pointer for the `ArcInner<T>`.
743
- unsafe fn allocate_for_unsized (
743
+ unsafe fn allocate_for_layout (
744
744
value_layout : Layout ,
745
745
mem_to_arcinner : impl FnOnce ( * mut u8 ) -> * mut ArcInner < T >
746
746
) -> * mut ArcInner < T > {
@@ -768,7 +768,7 @@ impl<T: ?Sized> Arc<T> {
768
768
/// Allocates an `ArcInner<T>` with sufficient space for an unsized value.
769
769
unsafe fn allocate_for_ptr ( ptr : * const T ) -> * mut ArcInner < T > {
770
770
// Allocate for the `ArcInner<T>` using the given value.
771
- Self :: allocate_for_unsized (
771
+ Self :: allocate_for_layout (
772
772
Layout :: for_value ( & * ptr) ,
773
773
|mem| set_data_ptr ( ptr as * mut T , mem) as * mut ArcInner < T > ,
774
774
)
@@ -799,7 +799,7 @@ impl<T: ?Sized> Arc<T> {
799
799
impl < T > Arc < [ T ] > {
800
800
/// Allocates an `ArcInner<[T]>` with the given length.
801
801
unsafe fn allocate_for_slice ( len : usize ) -> * mut ArcInner < [ T ] > {
802
- Self :: allocate_for_unsized (
802
+ Self :: allocate_for_layout (
803
803
Layout :: array :: < T > ( len) . unwrap ( ) ,
804
804
|mem| ptr:: slice_from_raw_parts_mut ( mem as * mut T , len) as * mut ArcInner < [ T ] > ,
805
805
)
0 commit comments