Пример #1
0
int HeapGraphSerializer::reportNodeImpl(const WTF::MemoryObjectInfo& info, int edgesCount)
{
    int nodeId = toNodeId(info.reportedPointer());

    m_nodes->addItem(info.className().isEmpty() ? m_unknownClassNameId : addString(info.className()));
    m_nodes->addItem(addString(info.name()));
    m_nodes->addItem(nodeId);
    m_nodes->addItem(info.objectSize());
    m_nodes->addItem(edgesCount);

    return nodeId;
}
Пример #2
0
void HeapGraphSerializer::reportNode(const WTF::MemoryObjectInfo& info)
{
    HeapGraphNode node;
    node.m_type = addString(info.objectType());
    node.m_size = info.objectSize();
    node.m_className = addString(info.className());
    node.m_name = addString(info.name());
    // Node is always reported after its outgoing edges and leaves.
    node.m_edgeCount = m_edges.size() - m_lastReportedEdgeIndex;
    m_lastReportedEdgeIndex = m_edges.size();

    m_objectToNodeIndex.set(info.reportedPointer(), m_nodes.size());
    m_nodes.append(node);
}
Пример #3
0
void HeapGraphSerializer::reportLeaf(const void*, const WTF::MemoryObjectInfo& info, const char* edgeName)
{
    HeapGraphNode node;
    node.m_type = addString(info.objectType());
    node.m_size = info.objectSize();
    node.m_className = addString(info.className());
    node.m_name = addString(info.name());

    int nodeIndex = m_nodes.size();
    m_nodes.append(node);

    HeapGraphEdge edge;
    edge.m_toIndex = nodeIndex;
    edge.m_targetIndexIsKnown = true;
    edge.m_name = addString(edgeName);
    m_edges.append(edge);
}