On 09/16/2011 04:13 AM, Dodji Seketeli wrote:
It seems odd to add in the locations size here since it's also printed
separately.
I wanted macro_maps_used_size to really reflect the total used size
for macro maps, without having to mentally do the addition of its two
components. But at the same time, I was interested in seeing how much
memory were the locations taking inside the macro map memory. As I
was suspecting them to take a lot of memory.
Right. I suppose my complaint is that the information is oddly
redundant. If you have two quantities A and B, is it more useful to
print A and B, or A+B and B? I don't object to printing the total of
the memory used by the maps and the locations, but I think all the
components should be printed as well.
It's hard to compare macro_maps_allocated_size with macro_maps_used_size
since you have to do subtraction to discover both values from what is
printed.
And do the addition in dump_line_table_statistics rather than store sums
in linemap_stats.
Also, linemap_stats and linemap_get_statistics need comments.
+/* Display an integer amount as multiple of 1K or 1M (in base 2à).
No UTF-8.
Jason