From 8257bd7554f5b897dfc86bac1021ba400ea3c347 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 20 Jan 2018 23:53:54 +0100 Subject: [PATCH] doxygen: save half of node size, as it is aligned to 16bit. Makes it possible to run on the whole Magnum symbol tree. --- doxygen/dox2html5.py | 11 +++++------ doxygen/test/test_search.py | 7 ++++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index a585210b..9294184b 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -52,9 +52,9 @@ import m.math import ansilexer class Trie: - # root | | header | values | child | - # offset | ... | size | value # | ... | offsets ... | - # 32b | | 8b | 8b | n*16b | 8b + 24b | + # root | | header | values | child | + # offset | ... | size/2 | value # | ... | offsets ... | + # 32b | | 8b | 8b | n*16b | 8b + 24b | root_offset_struct = struct.Struct(' 4: draw_pipe = True + if base_offset + size*2 - offset > 4: draw_pipe = True child_count = 0 - while offset < base_offset + size: + while offset < base_offset + size*2: if child_count or value_count: out += '\n' out += indent @@ -91,7 +91,7 @@ max node size: {} bytes max node values: {} max node children: {} max node value index: {} -max node child offset: {}""".lstrip().format(stats.node_count, stats.max_node_size, stats.max_node_values, stats.max_node_children, stats.max_node_value_index, stats.max_node_child_offset) +max node child offset: {}""".lstrip().format(stats.node_count, stats.max_node_size*2, stats.max_node_values, stats.max_node_children, stats.max_node_value_index, stats.max_node_child_offset) return out, stats def pretty_print_map(serialized: bytes): @@ -114,6 +114,7 @@ def pretty_print(serialized: bytes, show_merged=False): magic, version, map_offset = search_data_header_struct.unpack_from(serialized) assert magic == b'MCS' assert version == 0 + assert not search_data_header_struct.size % 4 pretty_trie, stats = pretty_print_trie(serialized[search_data_header_struct.size:map_offset], show_merged=show_merged) pretty_map = pretty_print_map(serialized[map_offset:]) -- 2.30.2