zstd_dstream...kspace_bound(9)
๐ zstd_dstream...kspace_bound(9)
okay so first things first, bestie โ the full title got cut off in the header (it be like that sometimes), but this page lives in the Kernel API Manual and it's all about one function. Let's get into it ๐ซถ
โจ NAME โจ
zstd_dstream_workspace_bound โ the function that tells you how much memory you need to initialize a zstd_dstream. literally it's the "how much room do I need" girlie of the zstd decompression-stream world ๐
๐ฆ SYNOPSIS ๐ฆ
size_t zstd_dstream_workspace_bound (size_t max_window_size );
like, that's the whole signature. one arg, one size back. cute and efficient ๐
๐ธ ARGUMENTS ๐ธ
max_window_sizeโ the maximum window size allowed for compressed frames. that's it, that's the whole vibe check. you tell it the biggest window you'll tolerate, it does math ๐งฎโจ
๐ RETURN ๐
it hands you back a lower bound on the size of the workspace that is passed to zstd_init_dstream. ngl, key word here is lower bound โ it's a minimum, not a promise from the universe ๐ so don't go assuming it's the exact number, just the floor you can't go under.
๐ SEE ALSO ๐
okay so this is the part where the page goes full main character and name-drops the entire zstd friend group. every single one, no cap:
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_create_ddict_byreference(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_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)
and where does the actual header live? Kernel file ./include/linux/zstd.h โ that's the spot, go read it, it's giving documentation ๐
๐ friendly reminder: the return value is a lower bound, so size your workspace at least that big before handing it to zstd_init_dstream. underestimating is not the slay you think it is.
anyway that's the page!! source is ./include/linux, part of the Kernel API Manual, dated October 2026 โ mwah, bye bestie, go decompress something ๐งโโ๏ธ๐๐
๐ฆ 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