mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Fixed CreateObject append alloc for non-debug-gc
This commit is contained in:
parent
e623449e24
commit
fd92b4ba93
1 changed files with 10 additions and 3 deletions
|
@ -174,15 +174,22 @@ namespace System.Reflection
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BF_ENABLE_OBJECT_DEBUG_FLAGS
|
#if BF_ENABLE_REALTIME_LEAK_CHECK
|
||||||
int32 stackCount = Compiler.Options.AllocStackCount;
|
int32 stackCount = Compiler.Options.AllocStackCount;
|
||||||
if (mAllocStackCountOverride != 0)
|
if (mAllocStackCountOverride != 0)
|
||||||
stackCount = mAllocStackCountOverride;
|
stackCount = mAllocStackCountOverride;
|
||||||
obj = Internal.Dbg_ObjectAlloc(mTypeClassVData, allocSize, mInstAlign, stackCount);
|
obj = Internal.Dbg_ObjectAlloc(mTypeClassVData, allocSize, mInstAlign, stackCount);
|
||||||
#else
|
#else
|
||||||
void* mem = new [Align(16)] uint8[mInstSize]* (?);
|
void* mem = new [Align(16)] uint8[allocSize]* (?);
|
||||||
obj = Internal.UnsafeCastToObject(mem);
|
obj = Internal.UnsafeCastToObject(mem);
|
||||||
obj.[Friend]mClassVData = (.)(void*)mTypeClassVData;
|
*(void**)mem = (void*)mTypeClassVData;
|
||||||
|
#if BF_ENABLE_OBJECT_DEBUG_FLAGS
|
||||||
|
Internal.Dbg_ObjectAllocated(obj, allocSize, (.)(void*)mTypeClassVData);
|
||||||
|
*(int*)mem |= 0x04/*BfObjectFlag_Allocate*/;
|
||||||
|
#else
|
||||||
|
*(void**)mem = (void*)mTypeClassVData;
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Internal.MemSet((uint8*)Internal.UnsafeCastToPtr(obj) + objType.mInstSize, 0, mInstSize - objType.mInstSize);
|
Internal.MemSet((uint8*)Internal.UnsafeCastToPtr(obj) + objType.mInstSize, 0, mInstSize - objType.mInstSize);
|
||||||
if (methodInfo.IsInitialized)
|
if (methodInfo.IsInitialized)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue