Skip to content

Commit 46d1361

Browse files
committed
offset can be zero
1 parent cfbc9a9 commit 46d1361

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pool/cas.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ impl<T> Ptr<T> {
177177
}
178178

179179
pub fn dangling() -> Self {
180-
unsafe { Self::from_parts(initial_tag_value(), core::mem::align_of::<T>() as i32) }
180+
// `anchor()` returns a well-aligned pointer so an offset of 0 will also produce a well-aligned pointer
181+
unsafe { Self::from_parts(initial_tag_value(), 0) }
181182
}
182183

183184
pub unsafe fn as_ref(&self) -> &T {

0 commit comments

Comments
 (0)