示例#1
0
文件: GC.cs 项目: sramos30/FlingOS
 public static void SetSignature(GCHeader* headerPtr)
 {
     headerPtr->Sig1 = 0x5C0EADE2U;
     headerPtr->Sig2 = 0x5C0EADE2U;
     headerPtr->Checksum = 0xB81D5BC4U;
 }
示例#2
0
文件: GC.cs 项目: sramos30/FlingOS
        private static void RemoveObjectToCleanup(GCHeader* objHeaderPtr)
        {
            EnterCritical("RemoveObjectToCleanup");

            try
            {
                ObjectToCleanup* currObjToCleanupPtr = CleanupList;
                while (currObjToCleanupPtr != null)
                {
                    if (currObjToCleanupPtr->objHeaderPtr == objHeaderPtr)
                    {
                        RemoveObjectToCleanup(currObjToCleanupPtr);
                        return;
                    }
                    currObjToCleanupPtr = currObjToCleanupPtr->prevPtr;
                }
            }
            finally
            {
                ExitCritical();
            }
        }
示例#3
0
文件: GC.cs 项目: sramos30/FlingOS
 public static unsafe bool CheckSignature(GCHeader* headerPtr)
 {
     bool OK = headerPtr->Sig1 == 0x5C0EADE2U;
     OK = OK && headerPtr->Sig2 == 0x5C0EADE2U;
     OK = OK && headerPtr->Checksum == 0xB81D5BC4U;
     return OK;
 }
示例#4
0
文件: GC.cs 项目: sramos30/FlingOS
        private static void AddObjectToCleanup(GCHeader* objHeaderPtr, void* objPtr)
        {
            EnterCritical("AddObjectToCleanup");

            try
            {
                ObjectToCleanup* newObjToCleanupPtr = (ObjectToCleanup*)Heap.AllocZeroed((uint)sizeof(ObjectToCleanup), "GC : AddObjectToCleanup");
                newObjToCleanupPtr->objHeaderPtr = objHeaderPtr;
                newObjToCleanupPtr->objPtr = objPtr;

                if (CleanupList != null)
                {
                    newObjToCleanupPtr->prevPtr = CleanupList;
                    CleanupList->nextPtr = newObjToCleanupPtr;
                }
                else
                {
                    newObjToCleanupPtr->prevPtr = null;
                    newObjToCleanupPtr->nextPtr = null;
                }
                
                CleanupList = newObjToCleanupPtr;
            }
            finally
            {
                ExitCritical();
            }
        }