summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Rast <tr@thomasrast.ch>2013-11-25 20:02:00 +0100
committerJunio C Hamano <gitster@pobox.com>2013-11-27 10:44:13 -0800
commitdcbbc8fa2e4210b3b564361cf794464ce8968946 (patch)
tree96351311aa229811334d6c79117396da61f4d6ae
parentc302941cd7670357bcd8209218e5f73c39e13d16 (diff)
downloadgit-dcbbc8fa2e4210b3b564361cf794464ce8968946.tar.gz
commit-slab: document clear_$slabname()
The clear_$slabname() function was only documented by source code so far. Write something about it. Signed-off-by: Thomas Rast <tr@thomasrast.ch> Helped-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--commit-slab.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/commit-slab.h b/commit-slab.h
index d4c8286470..acfef966c3 100644
--- a/commit-slab.h
+++ b/commit-slab.h
@@ -22,8 +22,17 @@
*
* Initializes the indegree slab that associates an array of integers
* to each commit. 'stride' specifies how big each array is. The slab
- * that id initialied by the variant without "_with_stride" associates
+ * that is initialized by the variant without "_with_stride" associates
* each commit with an array of one integer.
+ *
+ * - void clear_indegree(struct indegree *);
+ *
+ * Empties the slab. The slab can be reused with the same stride
+ * without calling init_indegree() again or can be reconfigured to a
+ * different stride by calling init_indegree_with_stride().
+ *
+ * Call this function before the slab falls out of scope to avoid
+ * leaking memory.
*/
/* allocate ~512kB at once, allowing for malloc overhead */