| 224 | } |
| 225 | |
| 226 | static 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 |
no test coverage detected