@@ -82,11 +82,13 @@ where
82
82
/// drop, use [`TaggedPtr`] instead.
83
83
///
84
84
/// [`TaggedPtr`]: crate::tagged_ptr::TaggedPtr
85
+ #[ inline]
85
86
pub fn new ( pointer : P , tag : T ) -> Self {
86
87
Self { packed : Self :: pack ( P :: into_ptr ( pointer) , tag) , tag_ghost : PhantomData }
87
88
}
88
89
89
90
/// Retrieves the pointer.
91
+ #[ inline]
90
92
pub fn pointer ( self ) -> P
91
93
where
92
94
P : Copy ,
@@ -123,6 +125,7 @@ where
123
125
/// according to `self.packed` encoding scheme.
124
126
///
125
127
/// [`P::into_ptr`]: Pointer::into_ptr
128
+ #[ inline]
126
129
fn pack ( ptr : NonNull < P :: Target > , tag : T ) -> NonNull < P :: Target > {
127
130
// Trigger assert!
128
131
let ( ) = Self :: ASSERTION ;
@@ -145,6 +148,7 @@ where
145
148
}
146
149
147
150
/// Retrieves the original raw pointer from `self.packed`.
151
+ #[ inline]
148
152
pub ( super ) fn pointer_raw ( & self ) -> NonNull < P :: Target > {
149
153
self . packed . map_addr ( |addr| unsafe { NonZeroUsize :: new_unchecked ( addr. get ( ) << T :: BITS ) } )
150
154
}
@@ -184,6 +188,7 @@ where
184
188
P : Pointer + Copy ,
185
189
T : Tag ,
186
190
{
191
+ #[ inline]
187
192
fn clone ( & self ) -> Self {
188
193
* self
189
194
}
@@ -196,6 +201,7 @@ where
196
201
{
197
202
type Target = P :: Target ;
198
203
204
+ #[ inline]
199
205
fn deref ( & self ) -> & Self :: Target {
200
206
// Safety:
201
207
// `pointer_raw` returns the original pointer from `P::into_ptr` which,
@@ -209,6 +215,7 @@ where
209
215
P : Pointer + DerefMut ,
210
216
T : Tag ,
211
217
{
218
+ #[ inline]
212
219
fn deref_mut ( & mut self ) -> & mut Self :: Target {
213
220
// Safety:
214
221
// `pointer_raw` returns the original pointer from `P::into_ptr` which,
@@ -235,6 +242,7 @@ where
235
242
P : Pointer ,
236
243
T : Tag ,
237
244
{
245
+ #[ inline]
238
246
fn eq ( & self , other : & Self ) -> bool {
239
247
self . packed == other. packed
240
248
}
@@ -252,6 +260,7 @@ where
252
260
P : Pointer ,
253
261
T : Tag ,
254
262
{
263
+ #[ inline]
255
264
fn hash < H : Hasher > ( & self , state : & mut H ) {
256
265
self . packed . hash ( state) ;
257
266
}
0 commit comments