| 620 | } |
| 621 | |
| 622 | inline 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 | |
| 655 | PUGI__FN_NO_INLINE xml_node_struct* append_node( |
| 656 | xml_node_struct* node, |
no test coverage detected