zstd_create..._byreference(9)
π 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. Thedictyou passed in has to be free before thezstd_ddictgets 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:
zstd_compress_bound(9)zstd_is_error(9)zstd_get_error_code(9)zstd_get_error_name(9)zstd_min_clevel(9)zstd_max_clevel(9)zstd_default_clevel(9)zstd_get_params(9)zstd_get_cparams(9)zstd_cctx_set_param(9)zstd_cctx_workspace_bound(9)zstd_cctx_workspace_bound_with_ext_seq_prod(9)zstd_init_cctx(9)zstd_compress_cctx(9)zstd_create_cctx_advanced(9)zstd_free_cctx(9)zstd_create_cdict_byreference(9)zstd_free_cdict(9)zstd_compress_using_cdict(9)zstd_dctx_workspace_bound(9)zstd_init_dctx(9)zstd_decompress_dctx(9)zstd_free_ddict(9)zstd_create_dctx_advanced(9)zstd_free_dctx(9)zstd_decompress_using_ddict(9)zstd_cstream_workspace_bound(9)zstd_cstream_workspace_bound_with_ext_seq_prod(9)zstd_init_cstream(9)zstd_reset_cstream(9)zstd_compress_stream(9)zstd_flush_stream(9)zstd_end_stream(9)zstd_dstream_workspace_bound(9)zstd_init_dstream(9)zstd_reset_dstream(9)zstd_decompress_stream(9)zstd_find_frame_compressed_size(9)zstd_get_frame_header(9)zstd_compress_sequences_and_literals(9)
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
- 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