aboutsummaryrefslogtreecommitdiff
path: root/show-index.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-01-21 15:25:19 -0800
committerJunio C Hamano <gitster@pobox.com>2010-01-21 20:03:45 -0800
commita5031214c4fe5f5d3fcf649d10769744cbc66fed (patch)
tree85f3cff5c42f5517af0c11a5238551f623f3c577 /show-index.c
parentfb7d3f32b283a3847e6f151a06794abd14ffd81b (diff)
downloadgit-a5031214c4fe5f5d3fcf649d10769744cbc66fed.tar.gz
git-a5031214c4fe5f5d3fcf649d10769744cbc66fed.tar.xz
slim down "git show-index"
As the documentation says, this is primarily for debugging, and in the longer term we should rename it to test-show-index or something. In the meantime, just avoid xmalloc (which slurps in the rest of git), and separating out the trivial hex functions into "hex.o". This results in [torvalds@nehalem git]$ size git-show-index text data bss dec hex filename 222818 2276 112688 337782 52776 git-show-index (before) 5696 624 1264 7584 1da0 git-show-index (after) which is a whole lot better. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'show-index.c')
-rw-r--r--show-index.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/show-index.c b/show-index.c
index 63f9da532..4c0ac138a 100644
--- a/show-index.c
+++ b/show-index.c
@@ -48,7 +48,7 @@ int main(int argc, char **argv)
unsigned char sha1[20];
uint32_t crc;
uint32_t off;
- } *entries = xmalloc(nr * sizeof(entries[0]));
+ } *entries = malloc(nr * sizeof(entries[0]));
for (i = 0; i < nr; i++)
if (fread(entries[i].sha1, 20, 1, stdin) != 1)
die("unable to read sha1 %u/%u", i, nr);