task: track number of Task objects in program and provide report

This is a simple lightweight counter that tracks the number of Task
objects that exist.  Useful for leak detection.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
Dieser Commit ist enthalten in:
Zygo Blaxell
2021-06-11 20:49:15 -04:00
Ursprung b7f9ce3f08
Commit d5ff35eacf
2 geänderte Dateien mit 30 neuen und 0 gelöschten Zeilen
+4
Datei anzeigen
@@ -47,6 +47,10 @@ namespace crucible {
/// Usually used to reschedule the currently executing Task.
static Task current_task();
/// Returns number of currently existing Task objects.
/// Good for spotting leaks.
static size_t instance_count();
/// Ordering operator for containers
bool operator<(const Task &that) const;