Skip to content

Commit 4763ada

Browse files
authored
Use is_multiple_of instead of % == 0 (#3244)
I was reading the changelog of 1.87 and noticed that it's stable now. Realised that I saw a todo in the code :) https://releases.rs/docs/1.87.0/
1 parent bb24fb5 commit 4763ada

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

libafl_intelpt/src/linux.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -724,8 +724,7 @@ impl IntelPTBuilder {
724724

725725
/// Set the size of the perf aux buffer (actual PT traces buffer)
726726
pub fn perf_aux_buffer_size(mut self, perf_aux_buffer_size: usize) -> Result<Self, Error> {
727-
// todo:replace with is_multiple_of once stable
728-
if perf_aux_buffer_size % PAGE_SIZE != 0 {
727+
if !perf_aux_buffer_size.is_multiple_of(PAGE_SIZE) {
729728
return Err(Error::illegal_argument(
730729
"IntelPT perf_aux_buffer must be page aligned",
731730
));

0 commit comments

Comments
 (0)