is_insidevar(9)
β¨ is_insidevar(9) β¨
okay so real quick bestie, before we even start β this is a page from the Kernel API Manual (section 9, kernel-nerd territory, iykyk) and honestly? it's short, it's sweet, and it ate. let's get into it π
πΈ NAME πΈ
is_insidevar β check if the @ptr points inside the @var memory range. that's it, that's the whole vibe check π«Ά
π SYNOPSIS π
is_insidevar (ptr , var );
literally just two things going in, no drama, no cap β¨ (yes the spacing is like that, we don't fix what isn't broken bestie π)
π ARGUMENTS π
ptrβ the pointer to a memory address. like, an actual address in memory. a location. a spot. πvarβ the variable which address and size identify the memory range. sovarisn't just sitting there looking cute (though it is π ) β its address plus its size are what define the memory range we're checking against. iconic behaviour honestly π
π¦ DESCRIPTION π¦
so here's the tea π: this macro evaluates to true if the address in ptr lies within the memory range allocated to var.
that's it!! that's the whole thing!! is the pointer inside the var's memory range? true or false, yes or no, slay or not-slay. one job, done perfectly, main character energy fr fr π
likeβ¦ it's giving "are you in your lane or are you trespassing" and honestly we respect that πΈ
π SEE ALSO π
go touch some other macros bestie, they're all right there in the kernel file ./include/linux/util_macros.h β here's the whole friend group π«Ά:
all of them iconic, all of them worth a read π
ok important lil heads up: this page lives under ./include/linux and the version/date situation is October 2026 β so if you're reading this from the future, hi, you're doing amazing, and yes we were all still saying "slay" ππ
and that's the whole page bestie!! short, sweet, ΓΊtil, obsessed with it, 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