/* 'size != 0' is for bpf_mem_alloc which manages fixed-size objects. *Allocandfreearedonewithbpf_mem_cache_{alloc,free}(). * *'size=0'isforbpf_mem_allocwhichmanagesmanyfixed-sizeobjects. *Allocandfreearedonewithbpf_mem_{alloc,free}()andthesizeof *thereturnedobjectisgivenbythesizeargumentofbpf_mem_alloc(). *Ifpercpuequalstrue,errorwillbereturnedinordertoavoid *largememoryconsumptionandthebelowbpf_mem_alloc_percpu_unit_init() *shouldbeusedtodoon-demandper-cpuallocationforeachsize.
*/ int bpf_mem_alloc_init(struct bpf_mem_alloc *ma, int size, bool percpu); /* Initialize a non-fix-size percpu memory allocator */ int bpf_mem_alloc_percpu_init(struct bpf_mem_alloc *ma, struct obj_cgroup *objcg); /* The percpu allocation with a specific unit size. */ int bpf_mem_alloc_percpu_unit_init(struct bpf_mem_alloc *ma, int size); void bpf_mem_alloc_destroy(struct bpf_mem_alloc *ma);
/* Check the allocation size for kmalloc equivalent allocator */ int bpf_mem_alloc_check_size(bool percpu, size_t size);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.