libbpf: Generalize common logic for managing dynamically-sized arrays
authorAndrii Nakryiko <andriin@fb.com>
Sat, 26 Sep 2020 01:13:51 +0000 (18:13 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 29 Sep 2020 00:27:31 +0000 (17:27 -0700)
commit192f5a1fe6894dca58d14dc883e6c7030e7267f7
treece117a588a970443c405f4ca0e94e368739d0451
parentb86042478fa083d87f1b67047e788d70b8c81eef
libbpf: Generalize common logic for managing dynamically-sized arrays

Managing dynamically-sized array is a common, but not trivial functionality,
which significant amount of logic and code to implement properly. So instead
of re-implementing it all the time, extract it into a helper function ans
reuse.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20200926011357.2366158-4-andriin@fb.com
tools/lib/bpf/btf.c
tools/lib/bpf/libbpf_internal.h