use std::marker::PhantomData;
use crate::utils::pointer::Pointer;
#[derive(Debug)]
pub struct MutVec<'a, T> {
ptr: Pointer<T>,
_phantom: PhantomData<&'a mut T>,
}
impl<'a, T> MutVec<'a, T> {
#[inline(always)]
pub fn new(ptr: Pointer<T>) -> Self {
Self {
ptr,
_phantom: PhantomData,
}
}
#[inline(always)]
pub fn write_unaligned(&self, value: T) {
unsafe {
self.ptr.ptr.write_unaligned(value);
}
}
#[inline(always)]
pub fn read_unaligned(&self) -> T {
unsafe { self.ptr.ptr.read_unaligned() }
}
}