Example #1
0
 private static void RemoveObjectToCleanup(GCHeader* objHeaderPtr)
 {
     //try
     {
         ObjectToCleanup* currObjToCleanupPtr = CleanupList;
         while (currObjToCleanupPtr != null)
         {
             if (currObjToCleanupPtr->objHeaderPtr == objHeaderPtr)
             {
                 RemoveObjectToCleanup(currObjToCleanupPtr);
                 return;
             }
             currObjToCleanupPtr = currObjToCleanupPtr->prevPtr;
         }
     }
     //finally
     {
     }
 }
Example #2
0
 public static void SetSignature(GCHeader* headerPtr)
 {
     headerPtr->Sig1 = 0x5C0EADE2U;
     headerPtr->Sig2 = 0x5C0EADE2U;
     headerPtr->Checksum = 0xB81D5BC4U;
 }
Example #3
0
        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;

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

                CleanupList = newObjToCleanupPtr;
            }
            //finally
            {
            }
        }
Example #4
0
 public static unsafe bool CheckSignature(GCHeader* headerPtr)
 {
     bool OK = headerPtr->Sig1 == 0x5C0EADE2U;
     OK = OK && headerPtr->Sig2 == 0x5C0EADE2U;
     OK = OK && headerPtr->Checksum == 0xB81D5BC4U;
     return OK;
 }