There are three categories of improvements:
(1) using size_t* rather than unsigned long* (and "%zX" rather than
"%lX"), to better support platforms where sizeof(long) !=
sizeof(void*), such as Win64 (untested, though). This is a
non-issue for 64-bit Linux (where I tested) and Mac.
(2) Using the correct amount of 0-padding when printing addresses to
show how much memory space is being printed. In other words, using
"%016zX" on 64-bit platforms instead of "%08zX". This change is
cosmetic-only, though it makes the logs much more understandable.
(3) [in leaksoup.cpp only] Fixing an occurrence of assuming that
sizeof(int) == sizeof(void*). This occurrence led to printing only
the lower half of each word in the output, after doing a correct
analysis of the memory graph.
This patch is patching three files:
(A) nsTraceMalloc.cpp, which is the in-process Gecko trace-malloc code
that generates the memory dumps.
(B) adreader.cpp, which is shared utility code for reading such a
memory dump (currently used only by leaksoup.cpp)
(C) leaksoup.cpp, which reads in such a memory dump, performs a
strongly connected components analysis of the memory graph, and
writes it back out, HTML-ized, with the roots listed at the top.
A fourth file appears to need no modification since it only looks at the
stack part of the dump and not the contents of the memory:
(D) diffbloatdump.pl, which diffs two bloat dumps and produces a stack
tree showing the change in allocations between them