xz_dec_microlzma_alloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… xz_dec_microlzma_alloc β€” kernel API manual, bestie edition ✨

okay so real talk, this one is from the Kernel API Manual and it's literally called xz_dec_microlzma_alloc and it's about getting memory ready for the MicroLZMA decoder πŸŽ€


✨ NAME ✨

xz_dec_microlzma_alloc β€” bestie, it allocates memory for the MicroLZMA decoder πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

struct xz_dec_microlzma * xz_dec_microlzma_alloc (enum xz_mode mode ,
uint32_t dict_size );

like yeah, that's the whole vibe ✨


🌸 ARGUMENTS 🌸

  • mode β€” it's giving XZ_SINGLE or XZ_PREALLOC, pick one bestie πŸ’…
  • dict_size β€” the LZMA dictionary size. ngl this one has rules: it must be at least 4 KiB and at most 3 GiB. no cap. go outside that range and it's not gonna work 😭

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea: in contrast to xz_dec_init, this function only allocates the memory and remembers the dictionary size. that's it, that's the whole job 🫢

🚨 important bestie!! xz_dec_microlzma_reset must be used before calling xz_dec_microlzma_run. like, do not skip this step, it's not optional, periodt πŸ’€

now the memory math, because yes we're doing math:

  • with XZ_SINGLE, the amount of allocated memory is a little less than 30 KiB ✨
  • with XZ_PREALLOC, you also get a dictionary buffer of dict_size bytes allocated πŸ‘‘

on success, xz_dec_microlzma_alloc returns a pointer to struct xz_dec_microlzma πŸŽ€

but if memory allocation fails, or dict_size is invalid? NULL is returned. that's the fail state, no cap πŸ™ˆ


πŸ”₯ SEE ALSO πŸ”₯


and that's the page bestie!! πŸ’– this little icon lives in ./include/linux, dated October 2026, and it's page xz_dec_microlzma_alloc(9) β€” go forth and decode πŸŒˆπŸ¦‹β­

πŸ“¦ where this page comes from