Home
last modified time | relevance | path

Searched refs:new_cnt (Results 1 – 4 of 4) sorted by relevance

/third_party/libbpf/src/
Dlinker.c250 size_t new_cnt = linker->sec_cnt ? linker->sec_cnt + 1 : 2; in add_dst_sec() local
252 secs = libbpf_reallocarray(secs, new_cnt, sizeof(*secs)); in add_dst_sec()
257 memset(secs + linker->sec_cnt, 0, (new_cnt - linker->sec_cnt) * sizeof(*secs)); in add_dst_sec()
260 linker->sec_cnt = new_cnt; in add_dst_sec()
262 sec = &linker->secs[new_cnt - 1]; in add_dst_sec()
263 sec->id = new_cnt - 1; in add_dst_sec()
519 size_t new_cnt = obj->sec_cnt ? obj->sec_cnt + 1 : 2; in add_src_sec() local
521 secs = libbpf_reallocarray(secs, new_cnt, sizeof(*secs)); in add_src_sec()
526 memset(secs + obj->sec_cnt, 0, (new_cnt - obj->sec_cnt) * sizeof(*secs)); in add_src_sec()
529 obj->sec_cnt = new_cnt; in add_src_sec()
[all …]
Dbtf.c159 size_t new_cnt; in libbpf_add_mem() local
169 new_cnt = *cap_cnt; in libbpf_add_mem()
170 new_cnt += new_cnt / 4; /* expand by 25% */ in libbpf_add_mem()
171 if (new_cnt < 16) /* but at least 16 elements */ in libbpf_add_mem()
172 new_cnt = 16; in libbpf_add_mem()
173 if (new_cnt > max_cnt) /* but not exceeding a set limit */ in libbpf_add_mem()
174 new_cnt = max_cnt; in libbpf_add_mem()
175 if (new_cnt < cur_cnt + add_cnt) /* also ensure we have enough memory */ in libbpf_add_mem()
176 new_cnt = cur_cnt + add_cnt; in libbpf_add_mem()
178 new_data = libbpf_reallocarray(*data, new_cnt, elem_sz); in libbpf_add_mem()
[all …]
Dusdt.c845 size_t new_cnt = man->free_spec_cnt + usdt_link->spec_cnt; in bpf_link_usdt_detach() local
848 new_free_ids = libbpf_reallocarray(man->free_spec_ids, new_cnt, in bpf_link_usdt_detach()
860 man->free_spec_cnt = new_cnt; in bpf_link_usdt_detach()
Dlibbpf.c6455 int new_cnt = main_prog->nr_reloc + subprog->nr_reloc; local
6461 relos = libbpf_reallocarray(main_prog->reloc_desc, new_cnt, sizeof(*relos));
6468 for (i = main_prog->nr_reloc; i < new_cnt; i++)
6474 main_prog->nr_reloc = new_cnt;
6482 size_t sub_insn_idx, insn_idx, new_cnt; local
6562 new_cnt = main_prog->insns_cnt + subprog->insns_cnt;
6563 insns = libbpf_reallocarray(main_prog->insns, new_cnt, sizeof(*insns));
6569 main_prog->insns_cnt = new_cnt;