RESOLVED FIXED 104630
Memory instrumentation: make sure each edge is reported only once
https://bugs.webkit.org/show_bug.cgi?id=104630
Summary Memory instrumentation: make sure each edge is reported only once
Yury Semikhatsky
Reported 2012-12-10 21:51:58 PST
In case of class B : public A we may come to object B first by B* and later by A* in which case all outgoing links will be reported twice.
Attachments
Patch (16.80 KB, patch)
2012-12-10 21:56 PST, Yury Semikhatsky
no flags
Patch (16.74 KB, patch)
2012-12-10 22:41 PST, Yury Semikhatsky
pfeldman: review+
buildbot: commit-queue-
Yury Semikhatsky
Comment 1 2012-12-10 21:56:55 PST
Yury Semikhatsky
Comment 2 2012-12-10 21:57:40 PST
(In reply to comment #1) > Created an attachment (id=178713) [details] > Patch Exported symbol lists probably need to be updated to make linker happy.
Ilya Tikhonovsky
Comment 3 2012-12-10 22:18:03 PST
Comment on attachment 178713 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=178713&action=review > Source/WTF/wtf/MemoryInstrumentation.cpp:91 > + callReportMemoryUsage(&memoryObjectInfo); > + > + const void* realAddress = memoryObjectInfo.reportedPointer(); realAddress could be a return value for callReportMemoryUsage > Source/WTF/wtf/MemoryInstrumentation.cpp:115 > + if (!m_memoryObjectInfo->objectSize()) { > + const void* instrumentedPointer = m_memoryObjectInfo->reportedPointer(); > + if (instrumentedPointer != objectAddress && instrumentedPointer && m_memoryInstrumentation->visited(objectAddress)) > + m_memoryObjectInfo->setAlreadyVisited(); > + } I'd move this logic into MemoryObjectInfo::reportObjectInfo method
Build Bot
Comment 4 2012-12-10 22:30:49 PST
Yury Semikhatsky
Comment 5 2012-12-10 22:34:07 PST
(In reply to comment #3) > (From update of attachment 178713 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=178713&action=review > > > Source/WTF/wtf/MemoryInstrumentation.cpp:91 > > + callReportMemoryUsage(&memoryObjectInfo); > > + > > + const void* realAddress = memoryObjectInfo.reportedPointer(); > > realAddress could be a return value for callReportMemoryUsage > The current approach seems more clear. Returning real address from callReportMemoryUsage would require access to memoryObjectInfo.reportedPointer() and MemoryObjectInfo definition is not available there. Alternative approach would be to return real address from reportMemoryUsage free function but that would touch too many files and I don't think it is justified. > > Source/WTF/wtf/MemoryInstrumentation.cpp:115 > > + if (!m_memoryObjectInfo->objectSize()) { > > + const void* instrumentedPointer = m_memoryObjectInfo->reportedPointer(); > > + if (instrumentedPointer != objectAddress && instrumentedPointer && m_memoryInstrumentation->visited(objectAddress)) > > + m_memoryObjectInfo->setAlreadyVisited(); > > + } > > I'd move this logic into MemoryObjectInfo::reportObjectInfo method Done.
Yury Semikhatsky
Comment 6 2012-12-10 22:41:20 PST
Build Bot
Comment 7 2012-12-10 23:12:05 PST
Yury Semikhatsky
Comment 8 2012-12-11 00:34:02 PST
Note You need to log in before you can comment on or make changes to this bug.