mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-20 00:50:25 +02:00
Made GC.Mark a mixin for less module rebuilding
This commit is contained in:
parent
92d3ab6ca9
commit
7724c6ae64
5 changed files with 18 additions and 34 deletions
|
@ -150,27 +150,27 @@ namespace System
|
|||
#endif
|
||||
}
|
||||
|
||||
public static void Mark<T>(T val) where T : class
|
||||
{
|
||||
public static mixin Mark<T>(T val) where T : class
|
||||
{
|
||||
#if BF_ENABLE_REALTIME_LEAK_CHECK
|
||||
Mark((Object)val);
|
||||
Mark((Object)val);
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void Mark<T>(T val) where T : struct
|
||||
{
|
||||
public static mixin Mark<T>(T val) where T : struct
|
||||
{
|
||||
#if BF_ENABLE_REALTIME_LEAK_CHECK
|
||||
val.[Friend]GCMarkMembers();
|
||||
val.[Friend]GCMarkMembers();
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void Mark<T>(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>(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, T, Size>(TSizedArray val) where Size : const int where TSizedArray : SizedArray<T, Size>
|
||||
public static mixin Mark<TSizedArray, T, Size>(TSizedArray val) where Size : const int where TSizedArray : SizedArray<T, Size>
|
||||
{
|
||||
#if BF_ENABLE_REALTIME_LEAK_CHECK
|
||||
for (var element in val)
|
||||
|
@ -180,22 +180,6 @@ namespace System
|
|||
#endif
|
||||
}
|
||||
|
||||
public static void Mark_Enumerate<T>(T val) where T : var
|
||||
{
|
||||
/*for (var element in val)
|
||||
{
|
||||
Mark(element);
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
public static void Mark_Unbound<T>(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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue