MCPcopy Create free account
hub / github.com/boostorg/build / hash_keyval

Function hash_keyval

v2/engine/object.c:132–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130
131
132static unsigned int hash_keyval( char const * key, int const size )
133{
134 unsigned int const magic = 2147059363;
135 unsigned int hash = 0;
136
137 unsigned int i;
138 for ( i = 0; i < size / sizeof( unsigned int ); ++i )
139 {
140 unsigned int val;
141 memcpy( &val, key, sizeof( unsigned int ) );
142 hash = hash * magic + val;
143 key += sizeof( unsigned int );
144 }
145
146 {
147 unsigned int val = 0;
148 memcpy( &val, key, size % sizeof( unsigned int ) );
149 hash = hash * magic + val;
150 }
151
152 return hash + ( hash >> 17 );
153}
154
155
156static void string_set_init( string_set * set )

Callers 2

string_set_insertFunction · 0.70
object_hashFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected