diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-05-14 15:25:52 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-05-22 14:40:30 -0700 |
commit | 862e730ec1c13f28bfb7c8c9ecb39bcc92dd0922 (patch) | |
tree | 83f241cbdd890926053221fd0932ab6d47217108 /merge-blobs.h | |
parent | Merge branch 'maint-1.9' into maint-2.0 (diff) | |
download | tgif-862e730ec1c13f28bfb7c8c9ecb39bcc92dd0922.tar.xz |
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 'merge-blobs.h')
0 files changed, 0 insertions, 0 deletions