Applications that use a commit message once and do not
need it again can free the body to save memory. Expose
the disposeBody() methods to support this and use it in
pgm.Log which only visits each commit once.
Change-Id: I4142a0749c24f15386ee7fb119934a0432234de3
outw.print(s);
outw.println();
}
+ c.disposeBody();
outw.println();
if (showNotes(c))
inDegree = 0;
}
- final void disposeBody() {
+ /**
+ * Discard the message buffer to reduce memory usage.
+ * <p>
+ * After discarding the memory usage of the {@code RevCommit} is reduced to
+ * only the {@link #getTree()} and {@link #getParents()} pointers and the
+ * time in {@link #getCommitTime()}. Accessing other properties such as
+ * {@link #getAuthorIdent()}, {@link #getCommitterIdent()} or either message
+ * function requires reloading the buffer by invoking
+ * {@link RevWalk#parseBody(RevObject)}.
+ *
+ * @since 4.0
+ */
+ public final void disposeBody() {
buffer = null;
}
return tagName;
}
- final void disposeBody() {
+ /**
+ * Discard the message buffer to reduce memory usage.
+ * <p>
+ * After discarding the memory usage of the {@code RevTag} is reduced to
+ * only the {@link #getObject()} pointer and {@link #getTagName()}.
+ * Accessing other properties such as {@link #getTaggerIdent()} or either
+ * message function requires reloading the buffer by invoking
+ * {@link RevWalk#parseBody(RevObject)}.
+ *
+ * @since 4.0
+ */
+ public final void disposeBody() {
buffer = null;
}
}