Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippGrulich committed Mar 23, 2024
1 parent 959c1f8 commit 89b8909
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nautilus-jit/include/Tracing/execution_trace.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace std {

template<>
struct hash<std::array<uint8_t, 256>> {
size_t operator()(const std::array<uint8_t, 256> &xyz) const;
size_t operator()( std::array<uint8_t, 256> &xyz) const;
};

template<>
Expand Down
5 changes: 3 additions & 2 deletions nautilus-jit/src/Tracing/execution_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ size_t std::hash<nautilus::tracing::StateSnapshot>::operator()(const nautilus::t
return std::hash<nautilus::tracing::Tag *>()(xyz.tag) ^ xyz.hash;
}

size_t std::hash<std::array<uint8_t, 256>>::operator()(const std::array<uint8_t, 256> &xyz) const {
size_t std::hash<std::array<uint8_t, 256>>::operator()( std::array<uint8_t, 256> &xyz) const {
std::hash<uint8_t> hasher;
size_t result = 0;
for (size_t i = 0; i < 256; ++i) {
result = result * 31 + hasher(xyz[i]);
auto val = xyz[i];
result = result * 31 + hasher(val);
}
return result;
}
Expand Down

0 comments on commit 89b8909

Please sign in to comment.