RESIZABLE_ARRAY(9)
π RESIZABLE_ARRAY(9) π
okay so welcome to the Kernel API Manual, bestie, and meet RESIZABLE_ARRAY β the macro that generates annotations for an array that may be resized. Iconic behavior, no cap. π¦
β¨ SYNOPSIS β¨
RESIZABLE_ARRAY (elfsec , arr );
π ARGUMENTS π
elfsecβ the data section of the BPF program in which to place the array.arrβ the name of the array.
π DESCRIPTION π
So libbpf has an API for setting map value sizes, okay? And since data sections β i.e. bss, data, rodata β are themselves maps, a data section can be resized. Slay. β¨
If a data section has an array as its last element, the BTF info for that array gets adjusted so that the length of the array is extended to meet the new length of the data section. Literally matching the glow-up. π
This macro annotates an array to have an element count of one, with the assumption that this array can be resized within the userspace program. It also annotates the section specifier so this array exists in a custom sub data section which can be resized independently. Two little annotations, both main-character energy. π
See RESIZE_ARRAY for the userspace convenience macro for resizing an array declared with RESIZABLE_ARRAY.
π₯ SEE ALSO π₯
Kernel file ./tools/sched_ext/include/scx/common.bpf.h says hi to these besties:
MEMBER_VPTR(9)ARRAY_ELEM_PTR(9)__sink(9)time_delta(9)time_after(9)time_before(9)time_after_eq(9)time_before_eq(9)time_in_range(9)time_in_range_open(9)
mwah π this page comes from ./tools/sched_ext/include/scx and itβs dated October 2026 β bye bestie, go resize something cute! π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms