diff options
| author | metamuffin <metamuffin@disroot.org> | 2026-02-17 00:17:43 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2026-02-17 00:17:43 +0100 |
| commit | f8b6afd57efc1a9e7e12fe1316bc45dcc6f32470 (patch) | |
| tree | 8cc7cbf2b3eebdc92b1e7c9d6ab9f34da3cd4169 /common/object/src/value.rs | |
| parent | b99fc498f2cf26c93d7888ea9aba4dd8cea60b2f (diff) | |
| download | jellything-f8b6afd57efc1a9e7e12fe1316bc45dcc6f32470.tar jellything-f8b6afd57efc1a9e7e12fe1316bc45dcc6f32470.tar.bz2 jellything-f8b6afd57efc1a9e7e12fe1316bc45dcc6f32470.tar.zst | |
fix object align bugs
Diffstat (limited to 'common/object/src/value.rs')
| -rw-r--r-- | common/object/src/value.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/common/object/src/value.rs b/common/object/src/value.rs index ac4cc9d..817ccdc 100644 --- a/common/object/src/value.rs +++ b/common/object/src/value.rs @@ -10,11 +10,11 @@ pub trait Value<'a>: ValueStore + Sized { const ALIGNED: bool; fn load_aligned(buf: &'a [u32]) -> Option<Self> { let _ = buf; - None + unimplemented!() } fn load_unaligned(buf: &'a [u8]) -> Option<Self> { let _ = buf; - None + unimplemented!() } } pub trait ValueStore { @@ -75,7 +75,7 @@ impl ValueStore for Tag { } } impl Value<'_> for u64 { - const ALIGNED: bool = false; + const ALIGNED: bool = true; fn load_aligned(buf: &[u32]) -> Option<Self> { let hi = u32::from_be(*buf.get(0)?) as u64; let lo = u32::from_be(*buf.get(1)?) as u64; @@ -95,7 +95,7 @@ impl ValueStore for u64 { } } impl Value<'_> for f64 { - const ALIGNED: bool = false; + const ALIGNED: bool = true; fn load_aligned(buf: &[u32]) -> Option<Self> { u32::load_aligned(buf).map(|x| x as f64) } @@ -112,7 +112,7 @@ impl ValueStore for f64 { } } impl Value<'_> for i64 { - const ALIGNED: bool = false; + const ALIGNED: bool = true; fn load_aligned(buf: &[u32]) -> Option<Self> { u32::load_aligned(buf).map(|x| x as i64) } |