mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 12:30:32 +00:00
30 lines
No EOL
804 B
C#
30 lines
No EOL
804 B
C#
using Cosmos.IL2CPU.Plugs;
|
|
|
|
namespace Cosmos.Core.Plugs.System
|
|
{
|
|
[Plug(Target = typeof(object))]
|
|
public class ObjectImpl
|
|
{
|
|
public static unsafe uint MemberwiseClone(uint aThis)
|
|
{
|
|
// pointers are handles!
|
|
|
|
|
|
var xThisPointer = (uint*)aThis;
|
|
|
|
var xSize = xThisPointer[1];
|
|
|
|
var xResult = GCImplementionImpl.AllocNewObject(xSize);
|
|
|
|
var xThatPointer = (uint*)xResult;
|
|
var xThatPointerByte = (byte*)xThatPointer[0];
|
|
var xThisSimplePointer = (uint*)aThis;
|
|
var xThisPointerByte = (byte*)xThisSimplePointer[0];
|
|
for (int i = 0; i < xSize; i++)
|
|
{
|
|
xThatPointerByte[i] = xThisPointerByte[i];
|
|
}
|
|
return xResult;
|
|
}
|
|
}
|
|
} |