Esempio n. 1
0
		private static void DeallocateHeap(GCHeap* pHeap)
		{
			// TODO: Thread-safety
			if (pHeap->Prev == null) HeapFirst = pHeap->Next;
			else pHeap->Prev->Next = pHeap->Next;
			if (pHeap->Next == null) HeapLast = pHeap->Prev;
			else pHeap->Next->Prev = pHeap->Prev;
			HeapAllocator.DeallocateHeap(pHeap);
		}
Esempio n. 2
0
		private static GCHeap* AllocateHeap(ulong pHeapSize, bool pSingleObject)
		{
			// TODO: Thread-safety
			if (StringTypeData == null) StringTypeData = typeof(string).GetTypeDataPointer();
			GCHeap* heap = HeapAllocator.AllocateHeap(pHeapSize, pSingleObject);
			if (HeapLast == null)
			{
				heap->Prev = null;
				heap->Next = null;
				HeapFirst = heap;
				HeapLast = heap;
			}
			else
			{
				HeapLast->Next = heap;
				heap->Prev = HeapLast;
				heap->Next = null;
				HeapLast = heap;
			}
			return heap;
		}