public static void AddFinalizer(/*HEAP_PTR*/ byte *ptr) { if (toFinalizeOfs >= toFinalizeCapacity) { toFinalizeCapacity <<= 1; ppToFinalize = (/*HEAP_PTR*/ byte **)Mem.realloc(ppToFinalize, (SIZE_T)(toFinalizeCapacity * sizeof(void *))); } ppToFinalize[toFinalizeOfs++] = ptr; }
public static void SetRoots(tHeapRoots *pHeapRoots, void *pRoots, uint sizeInBytes) { tHeapRootEntry *pRootEntry; System.Diagnostics.Debug.Assert((sizeInBytes & 0x3) == 0); if (pHeapRoots->num >= pHeapRoots->capacity) { pHeapRoots->capacity <<= 1; pHeapRoots->pHeapEntries = (tHeapRootEntry *)Mem.realloc(pHeapRoots->pHeapEntries, (SIZE_T)(pHeapRoots->capacity * sizeof(tHeapRootEntry))); } pRootEntry = &pHeapRoots->pHeapEntries[pHeapRoots->num++]; pRootEntry->numPointers = sizeInBytes >> 2; pRootEntry->pMem = (void **)pRoots; }