MCPcopy Create free account
hub / github.com/ImageEngine/cortex / deallocateWalk

Method deallocateWalk

src/IECore/StreamIndexedIO.cpp:2581–2605  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2579}
2580
2581void StreamIndexedIO::Index::deallocateWalk( NodeBase* n )
2582{
2583 assert(n);
2584
2585 // store the pointer for future deallocation
2586 m_removedNodes.push_back( n );
2587
2588 if ( n->nodeType() == NodeBase::Directory )
2589 {
2590 DirectoryNode *nn = static_cast< DirectoryNode *>(n);
2591
2592 for (DirectoryNode::ChildMap::const_iterator it = nn->children().begin(); it != nn->children().end(); ++it)
2593 {
2594 deallocateWalk( *it );
2595 }
2596
2597 nn->children().clear();
2598 }
2599 else
2600 {
2601 // We don't deallocate data node blocks because they could be referred by other nodes.
2602 // As a result, editing files will usually increase file size.
2603 }
2604
2605}
2606
2607void StreamIndexedIO::Index::commitNodeToSubIndex( DirectoryNode *n )
2608{

Callers 1

removeChildMethod · 0.80

Calls 4

nodeTypeMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected