@@ -8,8 +8,12 @@ use core::marker::PhantomData;
88use core:: ops:: { Add , AddAssign , Sub , SubAssign } ;
99
1010/// A physical memory frame.
11+ ///
12+ /// # Representation
13+ ///
14+ /// This struct has the same representation as a [`u64`].
1115#[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
12- #[ repr( C ) ]
16+ #[ repr( transparent ) ]
1317pub struct PhysFrame < S : PageSize = Size4KiB > {
1418 // TODO: Make private when our minimum supported stable Rust version is 1.61
1519 pub ( crate ) start_address : PhysAddr ,
@@ -134,7 +138,6 @@ impl<S: PageSize> Sub<PhysFrame<S>> for PhysFrame<S> {
134138
135139/// An range of physical memory frames, exclusive the upper bound.
136140#[ derive( Clone , PartialEq , Eq , Hash ) ]
137- #[ repr( C ) ]
138141pub struct PhysFrameRange < S : PageSize = Size4KiB > {
139142 /// The start of the range, inclusive.
140143 pub start : PhysFrame < S > ,
@@ -192,7 +195,6 @@ impl<S: PageSize> fmt::Debug for PhysFrameRange<S> {
192195
193196/// An range of physical memory frames, inclusive the upper bound.
194197#[ derive( Clone , PartialEq , Eq , Hash ) ]
195- #[ repr( C ) ]
196198pub struct PhysFrameRangeInclusive < S : PageSize = Size4KiB > {
197199 /// The start of the range, inclusive.
198200 pub start : PhysFrame < S > ,
0 commit comments