MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / AddGroupMemory

Function AddGroupMemory

Source/Engine/Profiler/ProfilerMemory.cpp:180–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178#endif
179
180 FORCE_INLINE void AddGroupMemory(ProfilerMemory::Groups group, int64 add)
181 {
182 // Group itself
183 Platform::InterlockedAdd(&GroupMemory[(int32)group], add);
184 Platform::InterlockedIncrement(&GroupMemoryCount[(int32)group]);
185 UpdateGroupTracyPlot(group);
186 UPDATE_PEEK(group);
187
188 // Total memory
189 Platform::InterlockedAdd(&GroupMemory[(int32)ProfilerMemory::Groups::TotalTracked], add);
190 Platform::InterlockedIncrement(&GroupMemoryCount[(int32)ProfilerMemory::Groups::TotalTracked]);
191 UPDATE_PEEK(ProfilerMemory::Groups::TotalTracked);
192
193 // Group hierarchy parents
194 uint8 parent = GroupParents[(int32)group];
195 while (parent != 0)
196 {
197 Platform::InterlockedAdd(&GroupMemory[parent], add);
198 Platform::InterlockedIncrement(&GroupMemoryCount[parent]);
199 UpdateGroupTracyPlot((ProfilerMemory::Groups)parent);
200 UPDATE_PEEK(parent);
201 parent = GroupParents[parent];
202 }
203 }
204
205 FORCE_INLINE void SubGroupMemory(ProfilerMemory::Groups group, int64 add)
206 {

Callers 2

IncrementGroupMethod · 0.85
OnMemoryAllocMethod · 0.85

Calls 3

UpdateGroupTracyPlotFunction · 0.85
InterlockedAddFunction · 0.50
InterlockedIncrementFunction · 0.50

Tested by

no test coverage detected