void HistoryGraph::projectCodeLocationsY(Snapshot * a_Snapshot, std::vector<int> & a_OutCoords)
{
	quint64 acc = 0;
	const auto & graphedPaths = m_Model->getGraphedAllocationPaths();
	auto numGraphedPaths = graphedPaths.size();
	for (size_t idx = 0; idx < numGraphedPaths; idx++)
	{
		auto allocation = a_Snapshot->findAllocation(graphedPaths[idx]->m_AllocationPath);
		if (allocation != nullptr)
		{
			acc += allocation->getAllocationSize();
			assert(acc <= a_Snapshot->getHeapSize());
		}
		a_OutCoords[idx] = projectionY(acc);
	}
	assert(acc == a_Snapshot->getHeapSize());
}
Exemple #2
0
void RCEnd()
{
	RCDestroy();

	Console::destroy();

	Command::destroy();

	SceneGraph::destroy();
	
	Renderer::destroy();

	if (getAllocationSize() != 0 || getCurrentAllocationCount() != 0) {
		REPORT_FILE("\n\nWarning: There are memory leaks! Check mem.txt for more info\n\n");
		ResultRelease();

		logAllocations();
	} else {
		ResultRelease();
	}
}
Exemple #3
0
	ChunkAllocator(size_t chunkSize) :
			m_ChunkSize(chunkSize), m_AvailableSlots(ChunkAllocatorBlocks), m_pData((char*) malloc(getAllocationSize(chunkSize))) {
		assert(PAGE_SIZE == (size_t) getPageSize());
		memset(m_UsedSlot, false, ChunkAllocatorBlocks);
		char* pBlockStart = reinterpret_cast<char*>(upperPage(reinterpret_cast<size_t>(m_pData)));
		const size_t realChunkSize = getChunkSize(chunkSize);
		for (int i = 0; i < ChunkAllocatorBlocks; ++i) {
			m_SlotData[i] = pBlockStart;
			Sentinel *pSentinel = getSentinelFromBlockStart(pBlockStart);
			pSentinel->pAllocator = this;
			pSentinel->magic = 0xDEADC0DE;
			pBlockStart += realChunkSize;
		}
	}