mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-13 05:44:11 +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
|
@ -319,7 +319,7 @@ namespace System
|
||||||
return;
|
return;
|
||||||
for (int i = 0; i < mLength; i++)
|
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++)
|
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++)
|
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++)
|
for (int i = 0; i < mLength; i++)
|
||||||
{
|
{
|
||||||
GC.Mark_Unbound((&mFirstElement)[i]);
|
GC.Mark!((&mFirstElement)[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,7 +177,7 @@ namespace System.Collections
|
||||||
return;
|
return;
|
||||||
for (int i < mCount)
|
for (int i < mCount)
|
||||||
{
|
{
|
||||||
GC.Mark_Unbound(mEntries[i]);
|
mEntries[i].[Friend]GCMarkMembers();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -721,7 +721,7 @@ namespace System.Collections
|
||||||
return;
|
return;
|
||||||
for (int i < mSize)
|
for (int i < mSize)
|
||||||
{
|
{
|
||||||
GC.Mark_Unbound(mItems[i]);
|
GC.Mark!(mItems[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -334,7 +334,7 @@ namespace System.Collections
|
||||||
int allocSize = AllocSize;
|
int allocSize = AllocSize;
|
||||||
for (int i < mSize)
|
for (int i < mSize)
|
||||||
{
|
{
|
||||||
GC.Mark_Unbound(mItems[(i + mHead) % allocSize]);
|
GC.Mark!(mItems[(i + mHead) % allocSize]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -150,27 +150,27 @@ namespace System
|
||||||
#endif
|
#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
|
#if BF_ENABLE_REALTIME_LEAK_CHECK
|
||||||
Mark((Object)val);
|
Mark((Object)val);
|
||||||
#endif
|
#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
|
#if BF_ENABLE_REALTIME_LEAK_CHECK
|
||||||
val.[Friend]GCMarkMembers();
|
val.[Friend]GCMarkMembers();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Mark<T>(T val) where T : struct*
|
public static mixin Mark<T>(T val) where T : struct*
|
||||||
{
|
{
|
||||||
// Memory pointed to by struct*'s will already-scanned stack memory,
|
// Memory pointed to by struct*'s will already-scanned stack memory,
|
||||||
// or the memory would already be registered with the GC
|
// 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
|
#if BF_ENABLE_REALTIME_LEAK_CHECK
|
||||||
for (var element in val)
|
for (var element in val)
|
||||||
|
@ -180,22 +180,6 @@ namespace System
|
||||||
#endif
|
#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)
|
public static void ToLeakString(Object obj, String strBuffer)
|
||||||
{
|
{
|
||||||
obj.GetType().GetName(strBuffer);
|
obj.GetType().GetName(strBuffer);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue