Skip to content

Commit

Permalink
Make RcBlock be #[repr(transparent)]
Browse files Browse the repository at this point in the history
To ensure the memory layout guarantee is correct.

See #655
  • Loading branch information
madsmtm committed Sep 23, 2024
1 parent afc0723 commit e9e09a6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crates/block2/src/rc_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use crate::{ffi, Block, IntoBlock, StackBlock};
/// Additionally, it participates in the null-pointer optimization, that is,
/// `Option<RcBlock<A, R>>` is guaranteed to have the same size as
/// `RcBlock<A, R>`.
#[repr(transparent)]
#[doc(alias = "MallocBlock")]
pub struct RcBlock<F: ?Sized> {
// Covariant
Expand Down

0 comments on commit e9e09a6

Please sign in to comment.