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

Function PropertyInitialize

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

Invoked when first property is initialized

Source from the content-addressed store, hash-verified

252
253// Invoked when first property is initialized
254static void PropertyInitialize()
255{
256 if (dmAtomicIncrement32(&g_PropertyInitialized) != 0)
257 return;
258
259 memset(g_Properties, 0, sizeof(g_Properties));
260 memset(g_PropertyData, 0, sizeof(g_PropertyData));
261
262 g_Lock = dmMutex::New();
263
264 g_Properties[0].m_Name = "Root";
265 g_Properties[0].m_NameHash = dmHashString32(g_Properties[0].m_Name);
266 g_Properties[0].m_Type = PROFILE_PROPERTY_TYPE_GROUP;
267 g_Properties[0].m_Parent = PROFILE_PROPERTY_INVALID_IDX;
268 g_Properties[0].m_FirstChild = PROFILE_PROPERTY_INVALID_IDX;
269 g_Properties[0].m_Sibling = PROFILE_PROPERTY_INVALID_IDX;
270 g_PropertyData[0].m_Used = 1; // used == 0, means we won't traverse it during display
271}
272
273static void ResetProperties(ProfileContext* ctx)
274{

Callers 1

SetThreadNameFunction · 0.70

Calls 2

dmAtomicIncrement32Function · 0.85
NewFunction · 0.50

Tested by

no test coverage detected