STACK_FLEX_ARRAY_SIZE(9)
π STACK_FLEX_ARRAY_SIZE(9) π
okay bestie, welcome to the Kernel API Manual β this page is about a tiny helper macro and honestly sheβs iconic for it π
β¨ NAME β¨
STACK_FLEX_ARRAY_SIZE is the helper macro for the DEFINE_FLEX() family. The way that it just returns the number of elements in @array is lowkey perfect π«Ά no cap, thatβs the whole gig.
πΈ SYNOPSIS πΈ
STACK_FLEX_ARRAY_SIZE (name , array );
π ARGUMENTS π
nameβ the name for a variable defined inDEFINE_RAW_FLEX/DEFINE_FLEX. sheβs basically the label for the variable, main character energy π·οΈarrayβ the name of the array member. the actual array bestie in question β¨
π¦ SEE ALSO π¦
the kernel file is ./include/linux/overflow.h β and hereβs the whole friend group, fr fr:
check_add_overflow(9)wrapping_add(9)wrapping_assign_add(9)check_sub_overflow(9)wrapping_sub(9)wrapping_assign_sub(9)check_mul_overflow(9)wrapping_mul(9)check_shl_overflow(9)overflows_type(9)range_overflows(9)range_overflows_t(9)range_end_overflows(9)range_end_overflows_t(9)castable_to_type(9)size_mul(9)size_add(9)size_sub(9)array_size(9)array3_size(9)flex_array_size(9)struct_size(9)struct_size_t(9)struct_offset(9)__DEFINE_FLEX(9)_DEFINE_FLEX(9)DEFINE_RAW_FLEX(9)DEFINE_FLEX(9)typeof_flex_counter(9)overflows_flex_counter_type(9)__set_flex_counter(9)
mwah π β source/version: ./include/linux; date: October 2026 πβ¨
π¦ 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