Add tools to help debug image GC (#4578)
`/debug-force-image-gc` will force garbage collection on all unused images `/debug-force-image-unload` will force unload all images Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -27,6 +27,22 @@ public:
|
||||
reinterpret_cast<int64_t &>(it.value())++;
|
||||
}
|
||||
}
|
||||
|
||||
static void set(const QString &name, const int64_t &amount)
|
||||
{
|
||||
auto counts = counts_.access();
|
||||
|
||||
auto it = counts->find(name);
|
||||
if (it == counts->end())
|
||||
{
|
||||
counts->insert(name, amount);
|
||||
}
|
||||
else
|
||||
{
|
||||
reinterpret_cast<int64_t &>(it.value()) = amount;
|
||||
}
|
||||
}
|
||||
|
||||
static void increase(const QString &name, const int64_t &amount)
|
||||
{
|
||||
auto counts = counts_.access();
|
||||
|
||||
Reference in New Issue
Block a user