]> git.ipfire.org Git - people/ms/libloc.git/commit - src/as-list.c
as-list: Grow faster to avoid too many re-allocations
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 9 Mar 2022 10:15:49 +0000 (10:15 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 9 Mar 2022 10:15:49 +0000 (10:15 +0000)
commitf13c23b76640abfa8e5066ed148fd8a60bce861c
tree8810a9d5e9ba1d449d5e83b47f7ebc4dfa1d0676
parent8649c6542400c38858721cd30dc53ce01ad1b4d8
as-list: Grow faster to avoid too many re-allocations

When we add a large number of ASes to the list, we will constantly
re-allocate the whole list because we are only growing it by 64 entries
at a time.

This patch changes that we will double the list in size every time we
run out of space and we will start with 1024 elements.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/as-list.c