Switched memory to using shared nodes, and node_data to keep only naked node pointers, not shared nodes (to break the cycle, and we don't need weak pointers because their memory is guaranteed to exist, via 'memory')

This commit is contained in:
beder
2011-09-09 02:29:17 -05:00
parent 37cd3bd53c
commit e32b3cd93f
9 changed files with 77 additions and 74 deletions

View File

@@ -14,11 +14,11 @@ namespace YAML
rhs.m_pMemory = m_pMemory;
}
shared_node memory::create_node()
node& memory::create_node()
{
shared_node_ref pRef(new node_ref);
m_nodes.insert(pRef);
return shared_node(new node(pRef));
shared_node pNode(new node);
m_nodes.insert(pNode);
return *pNode;
}
void memory::merge(const memory& rhs)