Skip to content
Snippets Groups Projects
  • Arseny Kapoulkine's avatar
    a567f12d
    Implement move support for xml_document · a567f12d
    Arseny Kapoulkine authored
    This change implements the initial version of move construction and
    assignment support for documents.
    
    When moving a document to another document, we always make sure move
    target is in "clean" state (empty document), and proceed by relocating
    all structures in the most efficient way possible.
    
    Complications arise from the fact that the root (document) node is
    embedded into xml_document object, so all pointers to it have to change;
    this includes parent pointers of all first-level children as well as
    allocator pointers in all memory pages and previous pointer in the first
    on-heap memory page.
    
    Additionally, compact mode makes everything even more complicated
    because some of the pointers we need to update are stored in the hash
    table (in fact, document first_child pointer is very likely to be there;
    some parent pointers in first-level children will be using
    compact_shared_parent but some won't be) which requires allocating a new
    hash table which can fail.
    
    Some details of this process are not fully fleshed out, especially for
    compact mode; and this definitely requires many tests.
    a567f12d
    History
    Implement move support for xml_document
    Arseny Kapoulkine authored
    This change implements the initial version of move construction and
    assignment support for documents.
    
    When moving a document to another document, we always make sure move
    target is in "clean" state (empty document), and proceed by relocating
    all structures in the most efficient way possible.
    
    Complications arise from the fact that the root (document) node is
    embedded into xml_document object, so all pointers to it have to change;
    this includes parent pointers of all first-level children as well as
    allocator pointers in all memory pages and previous pointer in the first
    on-heap memory page.
    
    Additionally, compact mode makes everything even more complicated
    because some of the pointers we need to update are stored in the hash
    table (in fact, document first_child pointer is very likely to be there;
    some parent pointers in first-level children will be using
    compact_shared_parent but some won't be) which requires allocating a new
    hash table which can fail.
    
    Some details of this process are not fully fleshed out, especially for
    compact mode; and this definitely requires many tests.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.