Skip to content

Commit dcbbc8f

Browse files
trastgitster
authored andcommitted
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 <[email protected]> Helped-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c302941 commit dcbbc8f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

commit-slab.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,17 @@
2222
*
2323
* Initializes the indegree slab that associates an array of integers
2424
* to each commit. 'stride' specifies how big each array is. The slab
25-
* that id initialied by the variant without "_with_stride" associates
25+
* that is initialized by the variant without "_with_stride" associates
2626
* each commit with an array of one integer.
27+
*
28+
* - void clear_indegree(struct indegree *);
29+
*
30+
* Empties the slab. The slab can be reused with the same stride
31+
* without calling init_indegree() again or can be reconfigured to a
32+
* different stride by calling init_indegree_with_stride().
33+
*
34+
* Call this function before the slab falls out of scope to avoid
35+
* leaking memory.
2736
*/
2837

2938
/* allocate ~512kB at once, allowing for malloc overhead */

0 commit comments

Comments
 (0)