mirror of
https://github.com/netdata/libbpf.git
synced 2026-11-08 02:40:15 +08:00
libbpf: Rename internal memory-management helpers
Rename btf_add_mem() and btf_ensure_mem() helpers that abstract away details of dynamically resizable memory to use libbpf_ prefix, as they are not BTF-specific. No functional changes. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20210318194036.3521577-4-andrii@kernel.org
This commit is contained in:
1 parent
74e94c40fe
commit
7fc514acf1
4 files changed
+21
-21
No files matched your search
+4
-4
@@ -166,11 +166,11 @@ static int btf_dump_resize(struct btf_dump *d)
|
||||
if (last_id <= d->last_id)
|
||||
return 0;
|
||||
|
||||
if (btf_ensure_mem((void **)&d->type_states, &d->type_states_cap,
|
||||
sizeof(*d->type_states), last_id + 1))
|
||||
if (libbpf_ensure_mem((void **)&d->type_states, &d->type_states_cap,
|
||||
sizeof(*d->type_states), last_id + 1))
|
||||
return -ENOMEM;
|
||||
if (btf_ensure_mem((void **)&d->cached_names, &d->cached_names_cap,
|
||||
sizeof(*d->cached_names), last_id + 1))
|
||||
if (libbpf_ensure_mem((void **)&d->cached_names, &d->cached_names_cap,
|
||||
sizeof(*d->cached_names), last_id + 1))
|
||||
return -ENOMEM;
|
||||
|
||||
if (d->last_id == 0) {
|
||||
|
||||
Reference in new issue
Block a user