Commit 352bbbd
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>1 parent 62cf3ca commit 352bbbd
1 file changed
Lines changed: 31 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1756 | 1756 | | |
1757 | 1757 | | |
1758 | 1758 | | |
1759 | | - | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
1760 | 1763 | | |
1761 | | - | |
1762 | | - | |
1763 | | - | |
1764 | | - | |
1765 | | - | |
1766 | | - | |
1767 | | - | |
1768 | | - | |
1769 | | - | |
1770 | | - | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
1771 | 1768 | | |
1772 | | - | |
| 1769 | + | |
1773 | 1770 | | |
| 1771 | + | |
1774 | 1772 | | |
1775 | | - | |
1776 | | - | |
1777 | | - | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
1778 | 1794 | | |
1779 | 1795 | | |
1780 | 1796 | | |
| |||
0 commit comments