private static Object Allocate(ref BumpAllocator profileData, VTable vtable, UIntPtr numBytes) { UIntPtr resultAddr = profileData.AllocateFast(numBytes, vtable.baseAlignment); Object result = Magic.fromAddress(resultAddr); result.REF_STATE = 1; result.vtable = vtable; return(result); }
internal override UIntPtr AllocateObjectMemory(UIntPtr numBytes, uint alignment, Thread currentThread) { UIntPtr resultAddr = BumpAllocator.AllocateFast(currentThread, numBytes, alignment); if (resultAddr == UIntPtr.Zero) { resultAddr = AllocateObjectMemorySlow(numBytes, alignment, currentThread); } VTable.Assert(resultAddr != UIntPtr.Zero); return(resultAddr); }