MCPcopy Create free account
hub / github.com/defold/defold / dmHashBuffer64

Function dmHashBuffer64

engine/dlib/src/dlib/hash.cpp:306–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304}
305
306uint64_t dmHashBuffer64(const void * key, uint32_t len)
307{
308 uint64_t h = dmHashBufferNoReverse64(key, len);
309
310 if (dmHashContainer().m_Enabled && len <= DMHASH_MAX_REVERSE_LENGTH)
311 {
312 DM_MUTEX_SCOPED_LOCK(dmHashContainer().m_Mutex);
313 dmHashTable64<ReverseHashEntry>* hash_table = &dmHashContainer().m_HashTable64Entries;
314 if (hash_table->Get(h) == 0)
315 {
316 if (hash_table->Full())
317 {
318 IncreaseTableCapacity(hash_table, dmHashContainer().m_HashTableCapacityIncrement);
319 }
320 char* copy = (char*) malloc(len + 1);
321 memcpy(copy, key, len);
322 copy[len] = '\0';
323 hash_table->Put(h, ReverseHashEntry(copy, len));
324 }
325 }
326
327 return h;
328}
329
330uint32_t DM_DLLEXPORT dmHashString32(const char* string)
331{

Callers 15

OpenFunction · 0.70
LoadFromBufferInternalFunction · 0.70
gameobject.cppFile · 0.50
CreateInstanceIdFunction · 0.50
SetIdentifierFunction · 0.50
GetAbsoluteIdentifierFunction · 0.50
ResolveURLFunction · 0.50
CheckHashOrStringFunction · 0.50
TEST_FFunction · 0.50
TEST_FFunction · 0.50

Calls 7

dmHashBufferNoReverse64Function · 0.85
IncreaseTableCapacityFunction · 0.85
mallocFunction · 0.85
ReverseHashEntryClass · 0.85
GetMethod · 0.45
FullMethod · 0.45
PutMethod · 0.45

Tested by 12

TEST_FFunction · 0.40
TEST_FFunction · 0.40
TEST_FFunction · 0.40
HandleIntegrityMessageFunction · 0.40
TESTFunction · 0.40
HttpResponseMethod · 0.40
dmHashCTestIncrementalFunction · 0.40
TEST_FFunction · 0.40
ResourceContainerCreateFunction · 0.40
TEST_PFunction · 0.40
ResolvePathCallbackFunction · 0.40