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

Function InternalizeName

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

Source from the content-addressed store, hash-verified

224}
225
226static uint32_t InternalizeName(const char* original, uint32_t* pname_hash)
227{
228 uint32_t name_hash = GetOrCacheNameHash(original, pname_hash);
229
230 if (g_ProfileContext->m_Names.Full())
231 {
232 uint32_t cap = g_ProfileContext->m_Names.Capacity() + 64;
233 g_ProfileContext->m_Names.SetCapacity((cap * 2) / 3, cap);
234 }
235
236 const char** existing = g_ProfileContext->m_Names.Get(name_hash);
237 if (existing)
238 {
239 return name_hash;
240 }
241
242 const char* name = strdup(original);
243 g_ProfileContext->m_Names.Put(name_hash, name);
244 return name_hash;
245}
246
247///////////////////////////////////////
248// PROPERTIES

Callers 1

ScopeBeginFunction · 0.85

Calls 6

GetOrCacheNameHashFunction · 0.85
FullMethod · 0.45
CapacityMethod · 0.45
SetCapacityMethod · 0.45
GetMethod · 0.45
PutMethod · 0.45

Tested by

no test coverage detected