summaryrefslogtreecommitdiff
path: root/commit-slab.h
diff options
context:
space:
mode:
authorThomas Rast <tr@thomasrast.ch>2013-11-25 19:02:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-11-27 18:44:13 (GMT)
commitdcbbc8fa2e4210b3b564361cf794464ce8968946 (patch)
tree96351311aa229811334d6c79117396da61f4d6ae /commit-slab.h
parentc302941cd7670357bcd8209218e5f73c39e13d16 (diff)
downloadgit-dcbbc8fa2e4210b3b564361cf794464ce8968946.zip
git-dcbbc8fa2e4210b3b564361cf794464ce8968946.tar.gz
git-dcbbc8fa2e4210b3b564361cf794464ce8968946.tar.bz2
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>
Diffstat (limited to 'commit-slab.h')
-rw-r--r--commit-slab.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/commit-slab.h b/commit-slab.h
index d4c8286..acfef96 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 */