Skip to content

Commit cd24c06

Browse files
Docs and FIXME
1 parent 5b248a0 commit cd24c06

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

library/core/src/alloc/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ use crate::fmt;
2727
use crate::ptr::{self, NonNull};
2828

2929
// @FIXME Make this target-specific
30+
/// Metadata for `Vec/VecDeque/RawVec` to assist the allocator. Make sure its
31+
/// alignment is not bigger than alignment of `usize`. Otherwise, even if (a
32+
/// particular) `Vec/VecDeque/RawVec` generic instance doesn't use cooperation,
33+
/// it would increase size of that `Vec/VecDeque/RawVec` because of alignment
34+
/// rules! @FIXME compile time test that `GlobalCoAllocMeta` alignment <=
35+
/// `usize` alignment.
3036
#[unstable(feature = "global_co_alloc_meta", issue = "none")]
3137
#[allow(missing_debug_implementations)]
3238
#[derive(Clone, Copy)]
@@ -84,6 +90,9 @@ pub type SliceAndMetaResult = Result<SliceAndMeta, AllocError>;
8490

8591
#[unstable(feature = "global_co_alloc", issue = "none")]
8692
pub const fn co_alloc_metadata_num_slots<A: Allocator>() -> usize {
93+
if true {
94+
panic!("FIXME - consider removing co_alloc_metadata_num_slots()");
95+
}
8796
if A::IS_CO_ALLOCATOR { 1 } else { 0 }
8897
}
8998

0 commit comments

Comments
 (0)