diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-05-15 01:25:52 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-05-23 00:40:30 +0300 |
commit | 862e730ec1c13f28bfb7c8c9ecb39bcc92dd0922 (patch) | |
tree | 83f241cbdd890926053221fd0932ab6d47217108 /refs.h | |
parent | 282616c72d1d08a77ca4fe1186cb708c38408d87 (diff) |
commit-slab: introduce slabname##_peek() function
There is no API to ask "Does this commit have associated data in
slab?". If an application wants to (1) parse just a few commits at
the beginning of a process, (2) store data for only these commits,
and then (3) start processing many commits, taking into account the
data stored (for a few of them) in the slab, the application would
use slabname##_at() to allocate a space to store data in (2), but
there is no API other than slabname##_at() to use in step (3). This
allocates and wastes new space for these commits the caller is only
interested in checking if they have data stored in step (2).
Introduce slabname##_peek(), which is similar to slabname##_at() but
returns NULL when there is no data already associated to it in such
a use case.
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.h')
0 files changed, 0 insertions, 0 deletions