blame.c: prepare_lines should not call xrealloc for every line
commit352bbbd9f24b39ae863ceb78170a2685d40e6416
authorDavid Kastrup <dak@gnu.org>
Wed, 12 Feb 2014 14:27:24 +0000 (12 15:27 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Feb 2014 22:32:41 +0000 (24 14:32 -0800)
treedbc461fc747fdd39acace7d8a289c87e86167ff3
parent62cf3ca95a7b34dcbf22d9ba4b2ea56f9fb739c9
blame.c: prepare_lines should not call xrealloc for every line

Making a single preparation run for counting the lines will avoid memory
fragmentation.  Also, fix the allocated memory size which was wrong
when sizeof(int *) != sizeof(int), and would have been too small
for sizeof(int *) < sizeof(int), admittedly unlikely.

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/blame.c