| 346 | } // Anonymous namespace |
| 347 | |
| 348 | uint16_t GetNextUid(bool peekOnly) |
| 349 | { |
| 350 | // The UID used for profiling objects and events. The first valid UID is 1, as 0 is a reserved value |
| 351 | static uint16_t uid = 1; |
| 352 | |
| 353 | // Check that it is possible to generate the next UID without causing an overflow (throws in case of error) |
| 354 | ThrowIfCantGenerateNextUid(uid); |
| 355 | |
| 356 | if (peekOnly) |
| 357 | { |
| 358 | // Peek only |
| 359 | return uid; |
| 360 | } |
| 361 | else |
| 362 | { |
| 363 | // Get the next UID |
| 364 | return uid++; |
| 365 | } |
| 366 | } |
| 367 | |
| 368 | std::vector<uint16_t> GetNextCounterUids(uint16_t firstUid, uint16_t cores) |
| 369 | { |