MCPcopy Create free account
hub / github.com/MayaPosch/NymphCast / GetStatistics

Method GetStatistics

src/server/angelscript/angelscript/source/as_gc.cpp:269–290  ·  view source on GitHub ↗

TODO: Additional statistics to gather - How many objects are added on average between each destroyed object - How many objects are added on average between each detected object - how many iterations are needed for each destroyed object - how many iterations are needed for each detected object The average must have a decay so that long running applications will not suffer from objects being creat

Source from the content-addressed store, hash-verified

267// When returning the average it should use a weighted average between the two buckets using the size as weight.
268// When a bucket is filled up, the buckets are switched, and then new bucket is emptied to gather new statistics.
269void asCGarbageCollector::GetStatistics(asUINT *currentSize, asUINT *totalDestroyed, asUINT *totalDetected, asUINT *newObjects, asUINT *totalNewDestroyed) const
270{
271 // It is not necessary to protect this with critical sections, however
272 // as it is not protected the variables can be filled in slightly different
273 // moments and might not match perfectly when inspected by the application
274 // afterwards.
275
276 if( currentSize )
277 *currentSize = (asUINT)(gcNewObjects.GetLength() + gcOldObjects.GetLength());
278
279 if( totalDestroyed )
280 *totalDestroyed = numDestroyed;
281
282 if( totalDetected )
283 *totalDetected = numDetected;
284
285 if( newObjects )
286 *newObjects = (asUINT)gcNewObjects.GetLength();
287
288 if( totalNewDestroyed )
289 *totalNewDestroyed = numNewDestroyed;
290}
291
292asCGarbageCollector::asSObjTypePair asCGarbageCollector::GetNewObjectAtIdx(int idx)
293{

Callers 2

GetGCStatisticsMethod · 0.80
ExecuteMethod · 0.80

Calls 1

GetLengthMethod · 0.45

Tested by

no test coverage detected