Skip to content

Commit

Permalink
Utilize std::assume_aligned
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroMemes committed Aug 1, 2024
1 parent c4c645f commit e0e4801
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/libhat/Scanner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ namespace hat {
}
uintptr_t mod = reinterpret_cast<uintptr_t>(ptr) % stride;
ptr += mod ? stride - mod : 0;
return ptr;
return std::assume_aligned<stride>(ptr);
}

template<scan_alignment alignment>
Expand All @@ -143,7 +143,7 @@ namespace hat {
return ptr;
}
uintptr_t mod = reinterpret_cast<uintptr_t>(ptr) % stride;
return ptr - mod;
return std::assume_aligned<stride>(ptr - mod);
}

template<scan_mode>
Expand Down

0 comments on commit e0e4801

Please sign in to comment.