Skip to content

Commit

Permalink
Always inline le64 for Wasm implementation
Browse files Browse the repository at this point in the history
Occassionally it gets uninlined (unsure why), but when it is not
inlined, a panic gets emitted, which is no fun.
  • Loading branch information
nickbabcock committed Jan 9, 2025
1 parent 482d7cb commit 10dd8d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ impl WasmHash {
impl_write!(WasmHash);
impl_hasher!(WasmHash);

#[inline]
// This occassionally doesn't get inlined, which causes panic code to get emitted
#[inline(always)]
fn le_u64(x: &[u8]) -> u64 {
u64::from_le_bytes([x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7]])
}
Expand Down

0 comments on commit 10dd8d0

Please sign in to comment.