diff options
Diffstat (limited to 'tools/ahat/src/DocString.java')
-rw-r--r-- | tools/ahat/src/DocString.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/ahat/src/DocString.java b/tools/ahat/src/DocString.java index c6303c8c35..7970bf8de4 100644 --- a/tools/ahat/src/DocString.java +++ b/tools/ahat/src/DocString.java @@ -126,6 +126,23 @@ class DocString { } /** + * Standard formatted DocString for describing a size. + * + * Nothing is printed for a size of zero. + * Set isPlaceHolder to true to indicate that the size field corresponds to + * for a place holder object that should be annotated specially. + */ + public static DocString size(long size, boolean isPlaceHolder) { + DocString string = new DocString(); + if (isPlaceHolder) { + string.append(DocString.removed("del")); + } else if (size != 0) { + string.appendFormat("%,14d", size); + } + return string; + } + + /** * Standard formatted DocString for describing a change in size relative to * a baseline. * @param noCurrent - whether no current object exists. |