Cosmos/source/Cosmos.Core.Plugs/GCImplementionImpl.cs
sgetaz b9800b52b7 Add new PlugMethodAttributes:
*RequiresPlug - Indicates that method requires a plug, and  throws a compiler exception if none exists.

*PlugNotImplemented - Method is plugged, but throws a compiler error if plug is not implemented correctly.
2015-08-13 00:41:22 +02:00

36 lines
1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cosmos.IL2CPU.Plugs;
namespace Cosmos.Core.Plugs
{
[Plug(TargetName = "Cosmos.IL2CPU.GCImplementation, Cosmos.IL2CPU")]
public static class GCImplementionImpl
{
public static uint AllocNewObject(uint aSize)
{
//if (Managed_Memory_System.ManagedMemory.SetUpDone == false)
//{
// return Managed_Memory_System.ManagedMemory.SetUpMemoryAlloc(aSize);
//}
//else
//{
// return Managed_Memory_System.ManagedMemory.KernelMemAlloc(aSize);
//}
return Heap.MemAlloc(aSize);
}
[PlugMethod(PlugNotImplemented = true)]
public static void IncRefCount(uint aObject)
{
//
}
[PlugMethod(PlugNotImplemented = true)]
public static void DecRefCount(uint aObject)
{
//
}
}
}