blame.c: prepare_lines should not call xrealloc for every line
authorDavid Kastrup <redacted>
Wed, 12 Feb 2014 14:27:24 +0000 (15:27 +0100)
committerJunio C Hamano <redacted>
Mon, 24 Feb 2014 22:32:41 +0000 (14:32 -0800)
commit352bbbd9f24b39ae863ceb78170a2685d40e6416
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
builtin/blame.c
git clone https://git.99rst.org/PROJECT