This commit is contained in:
Brendan Hansknecht 2024-04-09 19:52:30 -07:00
parent e31479f664
commit f87c32ca7d
No known key found for this signature in database
GPG key ID: 0EA784685083E75B
2 changed files with 1 additions and 53 deletions

View file

@ -101,7 +101,7 @@ where
let elem_ptr = Self::elem_ptr_from_alloc_ptr(alloc_ptr).cast::<ManuallyDrop<T>>();
// Initialize the reference count.
let rc_ptr = alloc_ptr.offset(offset as isize);
let rc_ptr = alloc_ptr.add(offset);
rc_ptr
.cast::<Storage>()
.write(Storage::new_reference_counted());
@ -949,13 +949,6 @@ where
}
}
const fn next_multiple_of(lhs: usize, rhs: usize) -> usize {
match lhs % rhs {
0 => lhs,
r => lhs + (rhs - r),
}
}
#[cfg(test)]
mod tests {
use super::*;