Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::vm::profile_data::item Struct Reference

#include <profile.hpp>

Collaboration diagram for sysio::vm::profile_data::item:

Public Member Functions

std::size_t hash () const
 
std::size_t hash () const
 

Public Attributes

list_header mru
 
itemnext
 
uint32_t bucket = 0xFFFFFFFF
 
uint32_t count = 0
 
uint32_t len
 
uint32_t frames [max_frames]
 

Detailed Description

Definition at line 104 of file profile.hpp.

Member Function Documentation

◆ hash() [1/2]

std::size_t sysio::vm::profile_data::item::hash ( ) const
inline

Definition at line 112 of file profile.hpp.

112 {
113 // MurmurHash64A
114 // Including len gives a multiple of 2.
115 static_assert(max_frames % 2 == 1);
116 // Not strictly necessary for correctness, but avoids unaligned loads
117 static_assert(offsetof(item, len) % 8 == 0);
118 constexpr std::uint64_t mul = 0xc6a4a7935bd1e995ull;
119 constexpr std::uint64_t seed = 0xbadd00d00ull;
120 constexpr auto shift_mix = [](std::uint64_t v) { return v ^ (v >> 47); };
121 int word_len = len/2+1; // if len is even, add an extra 0 word.
122 uint64_t hash = seed ^ (word_len * 8 * mul);
123 const char* base_addr = reinterpret_cast<const char*>(&len);
124 for(int i = 0; i < word_len; ++i) {
125 std::uint64_t val;
126 memcpy(&val, base_addr + 8*i, 8);
127 hash = (hash ^ shift_mix(val * mul) * mul) * mul;
128 }
129 return shift_mix(shift_mix(hash) * mul);
130 }
unsigned __int64 uint64_t
Definition stdint.h:136
static constexpr std::size_t max_frames
Definition profile.hpp:93
void mul(const Operand &op)
memcpy((char *) pInfo->slotDescription, s, l)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hash() [2/2]

std::size_t sysio::vm::profile_data::item::hash ( ) const
inline

Definition at line 112 of file profile.hpp.

112 {
113 // MurmurHash64A
114 // Including len gives a multiple of 2.
115 static_assert(max_frames % 2 == 1);
116 // Not strictly necessary for correctness, but avoids unaligned loads
117 static_assert(offsetof(item, len) % 8 == 0);
118 constexpr std::uint64_t mul = 0xc6a4a7935bd1e995ull;
119 constexpr std::uint64_t seed = 0xbadd00d00ull;
120 constexpr auto shift_mix = [](std::uint64_t v) { return v ^ (v >> 47); };
121 int word_len = len/2+1; // if len is even, add an extra 0 word.
122 uint64_t hash = seed ^ (word_len * 8 * mul);
123 const char* base_addr = reinterpret_cast<const char*>(&len);
124 for(int i = 0; i < word_len; ++i) {
125 std::uint64_t val;
126 memcpy(&val, base_addr + 8*i, 8);
127 hash = (hash ^ shift_mix(val * mul) * mul) * mul;
128 }
129 return shift_mix(shift_mix(hash) * mul);
130 }
Here is the call graph for this function:

Member Data Documentation

◆ bucket

uint32_t sysio::vm::profile_data::item::bucket = 0xFFFFFFFF

Definition at line 107 of file profile.hpp.

◆ count

uint32_t sysio::vm::profile_data::item::count = 0

Definition at line 108 of file profile.hpp.

◆ frames

uint32_t sysio::vm::profile_data::item::frames

Definition at line 110 of file profile.hpp.

◆ len

uint32_t sysio::vm::profile_data::item::len

Definition at line 109 of file profile.hpp.

◆ mru

list_header sysio::vm::profile_data::item::mru

Definition at line 105 of file profile.hpp.

◆ next

item * sysio::vm::profile_data::item::next

Definition at line 106 of file profile.hpp.


The documentation for this struct was generated from the following files: