fixup! extract common code into heapdump.cc