diff --git a/BeefLibs/corlib/src/Array.bf b/BeefLibs/corlib/src/Array.bf index d11fa7fe..96346e6b 100644 --- a/BeefLibs/corlib/src/Array.bf +++ b/BeefLibs/corlib/src/Array.bf @@ -319,7 +319,7 @@ namespace System return; for (int i = 0; i < mLength; i++) { - GC.Mark((&mFirstElement)[i]); + GC.Mark!((&mFirstElement)[i]); } } } @@ -430,7 +430,7 @@ namespace System { for (int i = 0; i < mLength; i++) { - GC.Mark_Unbound((&mFirstElement)[i]); + GC.Mark!((&mFirstElement)[i]); } } } @@ -546,7 +546,7 @@ namespace System { for (int i = 0; i < mLength; i++) { - GC.Mark_Unbound((&mFirstElement)[i]); + GC.Mark!((&mFirstElement)[i]); } } } @@ -667,7 +667,7 @@ namespace System { for (int i = 0; i < mLength; i++) { - GC.Mark_Unbound((&mFirstElement)[i]); + GC.Mark!((&mFirstElement)[i]); } } } diff --git a/BeefLibs/corlib/src/Collections/Dictionary.bf b/BeefLibs/corlib/src/Collections/Dictionary.bf index 2206e3c9..6c5545e0 100644 --- a/BeefLibs/corlib/src/Collections/Dictionary.bf +++ b/BeefLibs/corlib/src/Collections/Dictionary.bf @@ -177,7 +177,7 @@ namespace System.Collections return; for (int i < mCount) { - GC.Mark_Unbound(mEntries[i]); + mEntries[i].[Friend]GCMarkMembers(); } } diff --git a/BeefLibs/corlib/src/Collections/List.bf b/BeefLibs/corlib/src/Collections/List.bf index 3893c1af..23a12916 100644 --- a/BeefLibs/corlib/src/Collections/List.bf +++ b/BeefLibs/corlib/src/Collections/List.bf @@ -721,7 +721,7 @@ namespace System.Collections return; for (int i < mSize) { - GC.Mark_Unbound(mItems[i]); + GC.Mark!(mItems[i]); } } diff --git a/BeefLibs/corlib/src/Collections/Queue.bf b/BeefLibs/corlib/src/Collections/Queue.bf index 5ab1819b..a06ea748 100644 --- a/BeefLibs/corlib/src/Collections/Queue.bf +++ b/BeefLibs/corlib/src/Collections/Queue.bf @@ -334,7 +334,7 @@ namespace System.Collections int allocSize = AllocSize; for (int i < mSize) { - GC.Mark_Unbound(mItems[(i + mHead) % allocSize]); + GC.Mark!(mItems[(i + mHead) % allocSize]); } } diff --git a/BeefLibs/corlib/src/GC.bf b/BeefLibs/corlib/src/GC.bf index 2edf8100..1e0568d9 100644 --- a/BeefLibs/corlib/src/GC.bf +++ b/BeefLibs/corlib/src/GC.bf @@ -150,27 +150,27 @@ namespace System #endif } - public static void Mark(T val) where T : class - { + public static mixin Mark(T val) where T : class + { #if BF_ENABLE_REALTIME_LEAK_CHECK - Mark((Object)val); + Mark((Object)val); #endif } - public static void Mark(T val) where T : struct - { + public static mixin Mark(T val) where T : struct + { #if BF_ENABLE_REALTIME_LEAK_CHECK - val.[Friend]GCMarkMembers(); + val.[Friend]GCMarkMembers(); #endif } - public static void Mark(T val) where T : struct* - { - // Memory pointed to by struct*'s will already-scanned stack memory, - // or the memory would already be registered with the GC + public static mixin Mark(T val) where T : struct* + { + // Memory pointed to by struct*'s will already-scanned stack memory, + // or the memory would already be registered with the GC } - public static void Mark(TSizedArray val) where Size : const int where TSizedArray : SizedArray + public static mixin Mark(TSizedArray val) where Size : const int where TSizedArray : SizedArray { #if BF_ENABLE_REALTIME_LEAK_CHECK for (var element in val) @@ -180,22 +180,6 @@ namespace System #endif } - public static void Mark_Enumerate(T val) where T : var - { - /*for (var element in val) - { - Mark(element); - }*/ - } - - - public static void Mark_Unbound(T val) where T : var - { -#if BF_ENABLE_REALTIME_LEAK_CHECK - Mark(val); -#endif - } - public static void ToLeakString(Object obj, String strBuffer) { obj.GetType().GetName(strBuffer);