diff options
| author | Junio C Hamano <gitster@pobox.com> | 2020-07-30 13:20:30 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2020-07-30 13:20:30 -0700 |
| commit | de6dda0dc3d95cd9aaf43a7b85ceeb57316dcc27 (patch) | |
| tree | 8c970a139cd81136e71e6db49807b55878b6d54e /commit-slab-impl.h | |
| parent | Git 2.28 (diff) | |
| parent | commit-graph: simplify write_commit_graph_file() #2 (diff) | |
| download | git-de6dda0dc3d95cd9aaf43a7b85ceeb57316dcc27.tar.gz git-de6dda0dc3d95cd9aaf43a7b85ceeb57316dcc27.zip | |
Merge branch 'sg/commit-graph-cleanups' into master
The changed-path Bloom filter is improved using ideas from an
independent implementation.
* sg/commit-graph-cleanups:
commit-graph: simplify write_commit_graph_file() #2
commit-graph: simplify write_commit_graph_file() #1
commit-graph: simplify parse_commit_graph() #2
commit-graph: simplify parse_commit_graph() #1
commit-graph: clean up #includes
diff.h: drop diff_tree_oid() & friends' return value
commit-slab: add a function to deep free entries on the slab
commit-graph-format.txt: all multi-byte numbers are in network byte order
commit-graph: fix parsing the Chunk Lookup table
tree-walk.c: don't match submodule entries for 'submod/anything'
Diffstat (limited to 'commit-slab-impl.h')
| -rw-r--r-- | commit-slab-impl.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/commit-slab-impl.h b/commit-slab-impl.h index 5c0eb91a5d..557738df27 100644 --- a/commit-slab-impl.h +++ b/commit-slab-impl.h @@ -38,6 +38,19 @@ scope void clear_ ##slabname(struct slabname *s) \ FREE_AND_NULL(s->slab); \ } \ \ +scope void deep_clear_ ##slabname(struct slabname *s, void (*free_fn)(elemtype *)) \ +{ \ + unsigned int i; \ + for (i = 0; i < s->slab_count; i++) { \ + unsigned int j; \ + if (!s->slab[i]) \ + continue; \ + for (j = 0; j < s->slab_size; j++) \ + free_fn(&s->slab[i][j * s->stride]); \ + } \ + clear_ ##slabname(s); \ +} \ + \ scope elemtype *slabname## _at_peek(struct slabname *s, \ const struct commit *c, \ int add_if_missing) \ |
