| 491 | } |
| 492 | |
| 493 | inline void destroy_node(xml_node_struct* n, xml_allocator& alloc) |
| 494 | { |
| 495 | uintptr_t header = n->header; |
| 496 | |
| 497 | if (header & xml_memory_page_name_allocated_mask) alloc.deallocate_string(n->name); |
| 498 | if (header & xml_memory_page_value_allocated_mask) alloc.deallocate_string(n->value); |
| 499 | |
| 500 | for (xml_attribute_struct* attr = n->first_attribute; attr; ) |
| 501 | { |
| 502 | xml_attribute_struct* next = attr->next_attribute; |
| 503 | |
| 504 | destroy_attribute(attr, alloc); |
| 505 | |
| 506 | attr = next; |
| 507 | } |
| 508 | |
| 509 | for (xml_node_struct* child = n->first_child; child; ) |
| 510 | { |
| 511 | xml_node_struct* next = child->next_sibling; |
| 512 | |
| 513 | destroy_node(child, alloc); |
| 514 | |
| 515 | child = next; |
| 516 | } |
| 517 | |
| 518 | alloc.deallocate_memory(n, sizeof(xml_node_struct), reinterpret_cast<xml_memory_page*>(header & xml_memory_page_pointer_mask)); |
| 519 | } |
| 520 | |
| 521 | PUGIXML_NO_INLINE xml_node_struct* append_node(xml_node_struct* node, xml_allocator& alloc, xml_node_type type = node_element) |
| 522 | { |
no test coverage detected