Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shale: Remove dead code #333

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions shale/src/compact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,47 +213,6 @@ impl Storable for CompactSpaceHeader {
}
}

struct ObjPtrField(DiskAddress);

impl ObjPtrField {
const MSIZE: u64 = 8;
}

impl Storable for ObjPtrField {
fn hydrate<U: CachedStore>(addr: usize, mem: &U) -> Result<Self, ShaleError> {
let raw = mem
.get_view(addr, Self::MSIZE)
.ok_or(ShaleError::InvalidCacheView {
offset: addr,
size: Self::MSIZE,
})?;
let obj_ptr = raw.as_deref()[0..8].into();
Ok(Self(obj_ptr))
}

fn dehydrate(&self, to: &mut [u8]) -> Result<(), ShaleError> {
Cursor::new(to).write_all(&self.to_le_bytes())?;
Ok(())
}

fn dehydrated_len(&self) -> u64 {
Self::MSIZE
}
}

impl std::ops::Deref for ObjPtrField {
type Target = DiskAddress;
fn deref(&self) -> &DiskAddress {
&self.0
}
}

impl std::ops::DerefMut for ObjPtrField {
fn deref_mut(&mut self) -> &mut DiskAddress {
&mut self.0
}
}

#[derive(Debug)]
struct U64Field(u64);

Expand Down