Skip to content

Commit

Permalink
fn {generate_grain_uv,fguv_32x32xn}_{rust,c_erased}: Put `#[inline(…
Browse files Browse the repository at this point in the history
…never)]` on the `fn *_c_erased`s, not the `fn *_rust`s.

The C `NOINLINE`s were originally on the `*_c` functions, which are called through `fn` ptrs and makes sense.
The `fn *_rust`s are called only by the `fn *_c_erased`s, which are called through `fn` ptrs,
so we were accidentally forcing an extra `fn` call due to mixing this up.
  • Loading branch information
kkysen committed Nov 9, 2023
1 parent 382216d commit 73896f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/filmgrain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,6 @@ unsafe fn generate_grain_y_rust<BD: BitDepth>(
}
}

#[inline(never)]
unsafe fn generate_grain_uv_rust<BD: BitDepth>(
buf: &mut GrainLut<BD::Entry>,
buf_y: &GrainLut<BD::Entry>,
Expand Down Expand Up @@ -492,6 +491,7 @@ unsafe fn generate_grain_uv_rust<BD: BitDepth>(
}
}

#[inline(never)]
unsafe extern "C" fn generate_grain_uv_c_erased<
BD: BitDepth,
const NM: usize,
Expand Down Expand Up @@ -693,7 +693,6 @@ unsafe fn fgy_32x32xn_rust<BD: BitDepth>(
}
}

#[inline(never)]
unsafe fn fguv_32x32xn_rust<BD: BitDepth>(
dst_row: *mut BD::Pixel,
src_row: *const BD::Pixel,
Expand Down Expand Up @@ -850,6 +849,7 @@ unsafe fn fguv_32x32xn_rust<BD: BitDepth>(
}
}

#[inline(never)]
unsafe extern "C" fn fguv_32x32xn_c_erased<
BD: BitDepth,
const NM: usize,
Expand Down

0 comments on commit 73896f1

Please sign in to comment.