mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-14 14:24:10 +02:00
Fixed static init ordering issue with DbgRawAllocData.Unmarked<T>
This commit is contained in:
parent
e0ae4be43f
commit
f8083037f9
1 changed files with 13 additions and 6 deletions
|
@ -11,12 +11,19 @@ namespace System
|
||||||
|
|
||||||
public struct Unmarked<T>
|
public struct Unmarked<T>
|
||||||
{
|
{
|
||||||
public static DbgRawAllocData sRawAllocData;
|
static DbgRawAllocData sRawAllocData;
|
||||||
public static this()
|
public static DbgRawAllocData* Data
|
||||||
{
|
{
|
||||||
sRawAllocData.mMarkFunc = null;
|
get
|
||||||
sRawAllocData.mMaxStackTrace = 1;
|
{
|
||||||
sRawAllocData.mType = typeof(T);
|
if (sRawAllocData.mMaxStackTrace == 0)
|
||||||
|
{
|
||||||
|
sRawAllocData.mMarkFunc = null;
|
||||||
|
sRawAllocData.mMaxStackTrace = 1;
|
||||||
|
sRawAllocData.mType = typeof(T);
|
||||||
|
}
|
||||||
|
return &sRawAllocData;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -188,7 +195,7 @@ namespace System
|
||||||
return new T[size]*(?);
|
return new T[size]*(?);
|
||||||
// We don't want to use the default mark function because the GC will mark the entire array,
|
// We don't want to use the default mark function because the GC will mark the entire array,
|
||||||
// whereas we have a custom marking routine because we only want to mark up to mSize
|
// whereas we have a custom marking routine because we only want to mark up to mSize
|
||||||
return (T*)Internal.Dbg_RawAlloc(size * strideof(T), &DbgRawAllocData.Unmarked<T>.sRawAllocData);
|
return (T*)Internal.Dbg_RawAlloc(size * strideof(T), DbgRawAllocData.Unmarked<T>.Data);
|
||||||
#else
|
#else
|
||||||
return new T[size]*(?);
|
return new T[size]*(?);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue