MCPcopy Create free account
hub / github.com/MyGUI/mygui / destroy_node

Function destroy_node

Tools/EditorFramework/pugixml.cpp:622–653  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

620}
621
622inline void destroy_node(xml_node_struct* n, xml_allocator& alloc)
623{
624 uintptr_t header = n->header;
625
626 if (header & impl::xml_memory_page_name_allocated_mask)
627 alloc.deallocate_string(n->name);
628 if (header & impl::xml_memory_page_value_allocated_mask)
629 alloc.deallocate_string(n->value);
630
631 for (xml_attribute_struct* attr = n->first_attribute; attr;)
632 {
633 xml_attribute_struct* next = attr->next_attribute;
634
635 destroy_attribute(attr, alloc);
636
637 attr = next;
638 }
639
640 for (xml_node_struct* child = n->first_child; child;)
641 {
642 xml_node_struct* next = child->next_sibling;
643
644 destroy_node(child, alloc);
645
646 child = next;
647 }
648
649 alloc.deallocate_memory(
650 n,
651 sizeof(xml_node_struct),
652 reinterpret_cast<xml_memory_page*>(header & xml_memory_page_pointer_mask));
653}
654
655PUGI__FN_NO_INLINE xml_node_struct* append_node(
656 xml_node_struct* node,

Callers 1

remove_childMethod · 0.70

Calls 3

destroy_attributeFunction · 0.70
deallocate_stringMethod · 0.45
deallocate_memoryMethod · 0.45

Tested by

no test coverage detected