linear_range..._range_array(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… linear_range..._range_array(9) πŸŽ€

okay so real talk, this is a page straight out of the Kernel API Manual (linear_range..._range_array(9), yes that's the truncated little header bestie, it's the whole linear_range_values_in_range_array situation) and it's lowkey iconic once you get what it does. buckle up πŸ¦‹


✨ NAME ✨

linear_range_values_in_range_array β€” return the amount of values in ranges 🌸

like, it literally counts values for you. that's the whole vibe. no cap.


🌈 SYNOPSIS 🌈

unsigned int linear_range_values_in_range_array (const struct linear_range *r , int ranges );

she takes a pointer and a count and hands you back an unsigned int. periodt. πŸ‘‘


🫢 ARGUMENTS 🫢

  • r β€” pointer to an array of linear ranges where values are counted πŸ’– this is your little lineup of ranges, and she's gonna tally what's inside.
  • ranges β€” the amount of ranges we include in the computation ✨ so like, how many of them from that array actually get counted. pick your squad size.

πŸ’œ DESCRIPTION πŸ’œ

Compute the amount of values in ranges pointed by r. 🧚 easy. obsessed.

but here's the part where you gotta pay attention, bestie:

Note, values can be all equal β€” range with selectors 0,...,2 with step 0 still contains 3 values even though they are all equal. 😭

so yeah. even if every single value is identical and it's giving "why are there three of the same thing," the count is still 3. the values existing is what matters, not whether they're cute and different. don't come for her math, she's right. πŸ’…


⭐ RETURN ⭐

the amount of values in first ranges ranges pointed by r πŸŽ€

(and no, that's not a typo β€” it's literally "first ranges ranges," because ranges is the number of ranges you're including. iykyk πŸ”₯)


πŸ¦‹ SEE ALSO πŸ¦‹

her whole friend group, all in the kernel file ./lib/linear_ranges.c:


okay and that's the whole page πŸ’– this lil cutie lives in the ./lib source and this version is dated October 2026 in the good ol' Kernel API Manual β€” go count some values, bestie, you got this 🫢✨🌸

πŸ“¦ where this page comes from