obj_to_location(9)
π« obj_to_location β the kernel function that decodes your object value (manual page 9, kernel API vibes)
okay so bestie, welcome to the obj_to_location(9) glow-up π
this is the Kernel API Manual entry for obj_to_location, and it's literally the inverse-vibe decoder for zsmalloc land β it takes an encoded object value and hands you back where that object actually lives. no cap, it's giving "reverse the encoding and tell me the tea." π«Ά
β¨ NAME β¨
obj_to_location β get (<zpdesc>, <obj_idx>) from encoded object value πΈ
π SYNOPSIS π
void obj_to_location (unsigned long obj , struct zpdesc **zpdesc ,
unsigned int *obj_idx );
π¦ ARGUMENTS π¦
objβ the encoded object value π like, this is the mystery little value you're feeding in, and it's encoded, so we're about to un-encode it, periodt.zpdescβ zpdesc object resides in zspage β¨ (yes, that's the prose from the page verbatim-vibe β the zpdesc is the one hanging out in the zspage, iykyk).obj_idxβ object index π₯ the index of the object, served fresh through the pointer.
π SEE ALSO π
- Kernel file
./mm/zsmalloc.clocation_to_obj(9)β zs_lookup_class_index(9)πzs_huge_class_size(9)πzs_malloc(9)πzs_create_pool(9)π§
ngl bestie, double-check the pointer types before you go printing stuff βzpdescandobj_idxare both out-params here (double pointer and pointer respectively), so they're where the function writes its answers π the return type isvoid, so don't go looking for a return value, it's not coming π
and that's the whole page, bestie β no more options, no more flags, that's the entire tea π
this one shipped out of ./mm in October 2026, so go forth and decode those object values with main character energy πβ¨
π¦ 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