zstd_create..._byreference(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… zstd_create_ddict_byreference(9) β€” from the Kernel API Manual, bestie ✨

Okay so picture this: you're deep in kernel-land, you have a decompression dictionary just sitting there in memory, and you're like "do I really need to copy it?" No. No you don't. That's the whole vibe of this page πŸŽ€


🌸 NAME 🌸

zstd_create_ddict_byreference β€” Create decompression dictionary

Yes it's a lot of underscores, no we don't talk about it πŸ’€


✨ SYNOPSIS ✨

zstd_ddict * zstd_create_ddict_byreference (const void *dict , size_t
dict_size , zstd_custom_mem custom_mem );

That's the whole signature, character for character, don't @ me 🫢


🧚 ARGUMENTS 🧚

  • dict β€” pointer to the dictionary buffer. Your actual dictionary bytes live here πŸ’–
  • dict_size β€” size of the dictionary buffer. Gotta tell it how much of that buffer is real ✨
  • custom_mem β€” memory allocator. You bring your own, it uses it, iconic behavior πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

Note β€” and this is the part where you listen β€” this uses dict by reference (ZSTD_dlm_byRef), so dict should be free before zstd_ddict is destroyed.

⚠️ Lowkey critical: by reference means it does not copy your bytes. The dict you passed in has to be free before the zstd_ddict gets destroyed. Do not let it dangle, bestie, that's giving undefined behavior energy 😭

πŸ“ RETURN πŸ“

NULL on error, pointer to decompression dictionary otherwise. That's it. That's the return πŸ’…


🌈 SEE ALSO 🌈

Kernel file ./include/linux/zstd.h, plus the whole zstd fam β€” all of them, no skips:

Like I said. The whole fam. Read them, love them, cite them πŸ“šπŸ’œ


Okay that's the page!! Sourced from ./include/linux, dated October 2026, straight out of the Kernel API Manual 🌟 Go forth and not-copy your dictionaries, bestie β€” remember to free dict before you destroy that zstd_ddict, and slay πŸ’…πŸŽ€

πŸ“¦ where this page comes from