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

Function GetOrCacheNameHash

engine/profiler/src/basic/profiler_basic.cpp:212–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210}
211
212static uint32_t GetOrCacheNameHash(const char* name, uint32_t* pname_hash)
213{
214 if (pname_hash)
215 {
216 uint32_t name_hash = *pname_hash;
217 if (!name_hash)
218 {
219 *pname_hash = HashString32(name);
220 }
221 return *pname_hash;
222 }
223 return HashString32(name); // No cache to store it in, so we have to recalculate each time
224}
225
226static uint32_t InternalizeName(const char* original, uint32_t* pname_hash)
227{

Callers 2

InternalizeNameFunction · 0.85
ScopeBeginFunction · 0.85

Calls 1

HashString32Function · 0.85

Tested by

no test coverage detected