xz_dec_microlzma_alloc(9)
π 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 givingXZ_SINGLEorXZ_PREALLOC, pick one bestie πdict_sizeβ the LZMA dictionary size. ngl this one has rules: it must be at least4 KiBand at most3 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_resetmust be used before callingxz_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 than30 KiB⨠- with
XZ_PREALLOC, you also get a dictionary buffer ofdict_sizebytes 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 π₯
- Kernel file
./include/linux/xz.h enum xz_mode(9)enum xz_ret(9)struct xz_buf(9)xz_dec_init(9)xz_dec_run(9)xz_dec_reset(9)xz_dec_end(9)MicroLZMA decompressor(9)xz_dec_microlzma_reset(9)xz_dec_microlzma_run(9)xz_dec_microlzma_end(9)
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
- 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