Skip to content

Commit

Permalink
Revert "Add new PlugMethodAttributes:"
Browse files Browse the repository at this point in the history
This reverts commit b9800b5.
  • Loading branch information
sgetaz committed Aug 18, 2015
1 parent b9800b5 commit 8247a90
Show file tree
Hide file tree
Showing 4 changed files with 984 additions and 1,000 deletions.
3 changes: 1 addition & 2 deletions source/Cosmos.Core.Plugs/GCImplementionImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ public static uint AllocNewObject(uint aSize)
//}
return Heap.MemAlloc(aSize);
}
[PlugMethod(PlugNotImplemented = true)]

public static void IncRefCount(uint aObject)
{
//
}
[PlugMethod(PlugNotImplemented = true)]
public static void DecRefCount(uint aObject)
{
//
Expand Down
3 changes: 1 addition & 2 deletions source/Cosmos.IL2CPU.Plugs/PlugMethodAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ public sealed class PlugMethodAttribute: Attribute {
public Type Assembler = null;
public bool IsMonoOnly = false;
public bool IsMicrosoftdotNETOnly = false;
public bool RequiresPlug = false;
public bool PlugNotImplemented = false;

public bool IsWildcard = false;
public bool WildcardMatchParameters = false;
}
Expand Down
34 changes: 15 additions & 19 deletions source/Cosmos.IL2CPU/GCImplementation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,23 @@
using System.Threading;
using System.Diagnostics;
using Cosmos.Common;
using Cosmos.IL2CPU.Plugs;

namespace Cosmos.IL2CPU {
[DebuggerStepThrough]
public static class GCImplementation {
[PlugMethod(RequiresPlug = true)]
private static void AcquireLock() {
// do {
// } while (Interlocked.CompareExchange(ref mLock, 1, 0) != 0);
throw new NotImplementedException();
}
[PlugMethod(RequiresPlug = true)]
private static void ReleaseLock() {

private static void ReleaseLock() {
// do {
// } while (Interlocked.CompareExchange(ref mLock, 0, 1) != 1);
throw new NotImplementedException();
}
[PlugMethod(RequiresPlug = true)]
public static uint AllocNewObject(uint aSize) {

public static uint AllocNewObject(uint aSize) {
// uint xNewObject = RuntimeEngine.Heap_AllocNewObject(aSize + 4);
//#if GC_DEBUG
// Console.Write("New Object allocated: ");
Expand All @@ -38,12 +37,11 @@ public static uint AllocNewObject(uint aSize) {

}

/// <summary>
/// This function gets the pointer to the memory location of where it's stored.
/// </summary>
/// <param name="aObject"></param>
[PlugMethod(RequiresPlug = true)]
public static unsafe void IncRefCount(uint aObject) {
/// <summary>
/// This function gets the pointer to the memory location of where it's stored.
/// </summary>
/// <param name="aObject"></param>
public static unsafe void IncRefCount(uint aObject) {
//// if (aObject == 0) {
//// return;
//// }
Expand Down Expand Up @@ -79,13 +77,11 @@ public static unsafe void IncRefCount(uint aObject) {

}

/// <summary>
/// This function gets the pointer to the memory location of where it's stored.
/// </summary>
/// <param name="aObject"></param>
///
[PlugMethod(RequiresPlug = true)]
public static unsafe void DecRefCount(uint aObject) {
/// <summary>
/// This function gets the pointer to the memory location of where it's stored.
/// </summary>
/// <param name="aObject"></param>
public static unsafe void DecRefCount(uint aObject) {
//// if (aObject == 0) {
//// return;
//// }
Expand Down
Loading

0 comments on commit 8247a90

Please sign in to comment.