mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 09:04:53 -07:00
19 lines
453 B
C++
19 lines
453 B
C++
#ifndef COCKATRICE_SYSTEM_MEMORY_QUERIER_H
|
|
#define COCKATRICE_SYSTEM_MEMORY_QUERIER_H
|
|
|
|
#include <QtGlobal>
|
|
|
|
class SystemMemoryQuerier
|
|
{
|
|
public:
|
|
static qulonglong totalMemoryBytes();
|
|
static qulonglong availableMemoryBytes();
|
|
|
|
static bool hasAtLeastGiB(int gib)
|
|
{
|
|
const qulonglong GiB = 1024ull * 1024ull * 1024ull;
|
|
return totalMemoryBytes() >= (qulonglong)gib * GiB;
|
|
}
|
|
};
|
|
|
|
#endif // COCKATRICE_SYSTEM_MEMORY_QUERIER_H
|