예제 #1
0
파일: GC.cs 프로젝트: rmhasan/FlingOS
 private static void RemoveObjectToCleanup(GCHeader* objHeaderPtr)
 {
     //try
     {
         ObjectToCleanup* currObjToCleanupPtr = CleanupList;
         while (currObjToCleanupPtr != null)
         {
             if (currObjToCleanupPtr->objHeaderPtr == objHeaderPtr)
             {
                 RemoveObjectToCleanup(currObjToCleanupPtr);
                 return;
             }
             currObjToCleanupPtr = currObjToCleanupPtr->prevPtr;
         }
     }
     //finally
     {
     }
 }
예제 #2
0
파일: GC.cs 프로젝트: rmhasan/FlingOS
 public static void SetSignature(GCHeader* headerPtr)
 {
     headerPtr->Sig1 = 0x5C0EADE2U;
     headerPtr->Sig2 = 0x5C0EADE2U;
     headerPtr->Checksum = 0xB81D5BC4U;
 }
예제 #3
0
파일: GC.cs 프로젝트: rmhasan/FlingOS
        private static void AddObjectToCleanup(GCHeader* objHeaderPtr, void* objPtr)
        {
            //try
            {
                ObjectToCleanup* newObjToCleanupPtr = (ObjectToCleanup*)Heap.Alloc((uint)sizeof(ObjectToCleanup), "GC : AddObjectToCleanup");
                newObjToCleanupPtr->objHeaderPtr = objHeaderPtr;
                newObjToCleanupPtr->objPtr = objPtr;

                newObjToCleanupPtr->prevPtr = CleanupList;
                CleanupList->nextPtr = newObjToCleanupPtr;

                CleanupList = newObjToCleanupPtr;
            }
            //finally
            {
            }
        }
예제 #4
0
파일: GC.cs 프로젝트: rmhasan/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;
 }