array_size(9)
π array_size(9) β the Kernel API Manual, bestie edition π
okay so real talk, this one lives in the Kernel API Manual (that's the 9 in array_size(9) β kernel docs, iykyk β¨) and it's honestly such a tiny little icon. let me put you on. π
β¨ NAME β¨
array_size β calculate the size of a 2-dimensional array. that's it. that's the whole job. and she ate. π
π¦ SYNOPSIS π¦
size_t array_size (size_t a , size_t b );
like literally two size_t args and it hands you back a size_t. no drama, no cap. πΈ
π ARGUMENTS π
aβ dimension one π₯ (the first one, bestie, the first dimension)bβ dimension two π₯ (the second one, yes it's that simple)
π DESCRIPTION π
so here's the vibe: this function calculates the size of a 2-dimensional array. the math? absolutely iconic:
a * b
that's it. multiply dimension one by dimension two and you get the size. the way it just... multiplies. not me being obsessed with a multiplication. πβ¨
π₯ RETURN π₯
she returns the number of bytes needed to represent the array. π
β οΈ but watch out β on overflow she returnsSIZE_MAX. so if you seeSIZE_MAXcome back, that's the overflow flag, not a flex. do with that what you will. π
π SEE ALSO π
- the kernel file
./tools/include/linux/overflow.h(go read it, it's giving main character energy) size_mul(9)array3_size(9)struct_size(9)
they're all in the same friend group, fr fr. π«Ά
okay that's the whole page, bestie, and ngl you understood it first try. π§ this cutie came out of ./tools/include/linux, version dated October 2026 β and yes the header and the footer both say array_size(9) because she loves consistency. periodt. π
πβ
π¦ 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