unsigned int GameScriptParser::getIDOfPointerOrAdd(void *pPointer, UserPointerData::Types type) { if (containsPointer(pPointer)) { return getIDOfPointer(pPointer); } else { return addPointerToMap(pPointer, type); } }
void GarbageCollector::updatePointer(Oop *pointer) { // I only can update reference objects. if(!pointer->isPointer()) return; // Is this a weak reference that was collected? if(pointer->header->gcColor == White) { *pointer = Oop(); return; } // Is this object in the heap? auto heap = memoryManager->getHeap(); if(!heap->containsPointer(pointer->pointer)) return; // Use the forwarding pointer. uint8_t **forwardingPointer = reinterpret_cast<uint8_t**> (pointer->pointer - sizeof(uint8_t*)); pointer->pointer = *forwardingPointer; }