Force GC to run periodically in order to reduce stuttering

This commit is contained in:
2023-05-08 21:13:55 +03:00
parent 69cdb1268a
commit da149d32cf
7 changed files with 78 additions and 3 deletions

View File

@@ -106,6 +106,8 @@ public:
{
static void Collect();
static void Collect(int32 generation);
static void Collect(int32 generation, MGCCollectionMode collectionMode, bool blocking, bool compacting);
static int32 MaxGeneration();
static void WaitForPendingFinalizers();
static void WriteRef(void* ptr, MObject* ref);
static void WriteValue(void* dst, void* src, int32 count, const MClass* klass);

View File

@@ -56,6 +56,14 @@ enum class MTypes : uint32
Enum = 0x55,
};
enum class MGCCollectionMode
{
Default = 0,
Forced = 1,
Optimized = 2,
Aggressive = 3
};
#if USE_NETCORE
enum class MTypeAttributes : uint32;