@@ -82,11 +82,13 @@ where
8282 /// drop, use [`TaggedPtr`] instead.
8383 ///
8484 /// [`TaggedPtr`]: crate::tagged_ptr::TaggedPtr
85+ #[ inline]
8586 pub fn new ( pointer : P , tag : T ) -> Self {
8687 Self { packed : Self :: pack ( P :: into_ptr ( pointer) , tag) , tag_ghost : PhantomData }
8788 }
8889
8990 /// Retrieves the pointer.
91+ #[ inline]
9092 pub fn pointer ( self ) -> P
9193 where
9294 P : Copy ,
@@ -123,6 +125,7 @@ where
123125 /// according to `self.packed` encoding scheme.
124126 ///
125127 /// [`P::into_ptr`]: Pointer::into_ptr
128+ #[ inline]
126129 fn pack ( ptr : NonNull < P :: Target > , tag : T ) -> NonNull < P :: Target > {
127130 // Trigger assert!
128131 let ( ) = Self :: ASSERTION ;
@@ -145,6 +148,7 @@ where
145148 }
146149
147150 /// Retrieves the original raw pointer from `self.packed`.
151+ #[ inline]
148152 pub ( super ) fn pointer_raw ( & self ) -> NonNull < P :: Target > {
149153 self . packed . map_addr ( |addr| unsafe { NonZeroUsize :: new_unchecked ( addr. get ( ) << T :: BITS ) } )
150154 }
@@ -184,6 +188,7 @@ where
184188 P : Pointer + Copy ,
185189 T : Tag ,
186190{
191+ #[ inline]
187192 fn clone ( & self ) -> Self {
188193 * self
189194 }
@@ -196,6 +201,7 @@ where
196201{
197202 type Target = P :: Target ;
198203
204+ #[ inline]
199205 fn deref ( & self ) -> & Self :: Target {
200206 // Safety:
201207 // `pointer_raw` returns the original pointer from `P::into_ptr` which,
@@ -209,6 +215,7 @@ where
209215 P : Pointer + DerefMut ,
210216 T : Tag ,
211217{
218+ #[ inline]
212219 fn deref_mut ( & mut self ) -> & mut Self :: Target {
213220 // Safety:
214221 // `pointer_raw` returns the original pointer from `P::into_ptr` which,
@@ -235,6 +242,7 @@ where
235242 P : Pointer ,
236243 T : Tag ,
237244{
245+ #[ inline]
238246 fn eq ( & self , other : & Self ) -> bool {
239247 self . packed == other. packed
240248 }
@@ -252,6 +260,7 @@ where
252260 P : Pointer ,
253261 T : Tag ,
254262{
263+ #[ inline]
255264 fn hash < H : Hasher > ( & self , state : & mut H ) {
256265 self . packed . hash ( state) ;
257266 }
0 commit comments