mirror of
https://github.com/wolfpld/tracy
synced 2025-05-01 13:13:53 +00:00
fixing collect wrap-around
This commit is contained in:
parent
a9538799da
commit
ad2c2efacd
@ -208,6 +208,11 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (RingIndex(begin) + count > RingSize())
|
||||||
|
{
|
||||||
|
count = RingSize() - RingIndex(begin);
|
||||||
|
}
|
||||||
|
|
||||||
if (count >= MaxQueries)
|
if (count >= MaxQueries)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "TracyMetal: Collect: FULL [%llu, %llu] (%d)\n", begin, latestCheckpoint, count);
|
fprintf(stdout, "TracyMetal: Collect: FULL [%llu, %llu] (%d)\n", begin, latestCheckpoint, count);
|
||||||
@ -292,6 +297,11 @@ private:
|
|||||||
return static_cast<uint32_t>(count);
|
return static_cast<uint32_t>(count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tracy_force_inline uint32_t RingSize() const
|
||||||
|
{
|
||||||
|
return MaxQueries;
|
||||||
|
}
|
||||||
|
|
||||||
tracy_force_inline unsigned int NextQueryId(int n=1)
|
tracy_force_inline unsigned int NextQueryId(int n=1)
|
||||||
{
|
{
|
||||||
auto id = m_queryCounter.fetch_add(n);
|
auto id = m_queryCounter.fetch_add(n);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user