From dcbbc8fa2e4210b3b564361cf794464ce8968946 Mon Sep 17 00:00:00 2001
From: Thomas Rast
Date: Mon, 25 Nov 2013 20:02:00 +0100
Subject: 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
Helped-by: Jonathan Nieder
Signed-off-by: Junio C Hamano
---
commit-slab.h | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
(limited to 'commit-slab.h')
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 */
--
cgit v1.2.3