diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2014-11-08 20:05:12 +0100 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2014-11-08 20:05:12 +0100 |
commit | cca23e636354dc73429a19e14e32cc9a5e632735 (patch) | |
tree | 4673f508a2e9b7e6acf1dd8efdf9c4a6cfb2277f /src/pugixml.cpp | |
parent | c74dc3360470dd68646dbce80d9d088d84946610 (diff) |
Reduce required page alignment to 32
Since we no longer have a name/value pair in nodes we need one less bit to
represent allocated flags. This reduces the page overhead by 32 bytes.
Diffstat (limited to 'src/pugixml.cpp')
-rw-r--r-- | src/pugixml.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp index e92ae60..f0efa90 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -407,13 +407,19 @@ PUGI__NS_BEGIN #endif ; - static const uintptr_t xml_memory_page_alignment = 64; + static const uintptr_t xml_memory_page_alignment = 32; static const uintptr_t xml_memory_page_pointer_mask = ~(xml_memory_page_alignment - 1); - static const uintptr_t xml_memory_page_contents_shared_mask = 32; - static const uintptr_t xml_memory_page_contents_allocated_mask = 16; - static const uintptr_t xml_memory_page_name_allocated_mask = 16; - static const uintptr_t xml_memory_page_value_allocated_mask = 8; + + // extra metadata bits for xml_node_struct + static const uintptr_t xml_memory_page_contents_shared_mask = 16; + static const uintptr_t xml_memory_page_contents_allocated_mask = 8; static const uintptr_t xml_memory_page_type_mask = 7; + + // extra metadata bits for xml_attribute_struct + static const uintptr_t xml_memory_page_name_allocated_mask = 2; + static const uintptr_t xml_memory_page_value_allocated_mask = 1; + + // combined masks for string uniqueness static const uintptr_t xml_memory_page_name_allocated_or_shared_mask = xml_memory_page_name_allocated_mask | xml_memory_page_contents_shared_mask; static const uintptr_t xml_memory_page_value_allocated_or_shared_mask = xml_memory_page_value_allocated_mask | xml_memory_page_contents_shared_mask; static const uintptr_t xml_memory_page_contents_allocated_or_shared_mask = xml_memory_page_contents_allocated_mask | xml_memory_page_contents_shared_mask; |