LZ4_loadDict(9)
π LZ4_loadDict(9) β the kernel API manual, but make it make sense π
okay so this is from the Kernel API Manual, section 9, and honestly? it's giving "tiny function, big responsibilities." let's get into it π
β¨ NAME β¨
LZ4_loadDict β bestie, this one loads a static dictionary into an LZ4_stream. that's the whole vibe. π
πΈ SYNOPSIS πΈ
int LZ4_loadDict (LZ4_stream_t *streamPtr , const char *dictionary , int
dictSize );
like, three args, one int coming back at you. we love a simple signature fr fr π«Ά
π¦ ARGUMENTS π¦
streamPtrβ pointer to theLZ4_stream_t. your stream. your main character. it's the thing you're shoving the dict into β¨dictionaryβ the dictionary you're loading. literally the dict in question πdictSizeβ size of the dictionary. gotta tell it how big the thing is, no cap π
π DESCRIPTION π
so here's the tea β β use this function to load a static dictionary into LZ4_stream.
and listen, this is the important part: ANY previous data will be forgotten. not archived, not tucked away, not "we'll deal with it later" β forgotten π only dictionary will remain in memory. so if you had stuff in there you cared about, sorry bestie, it's gone π
also, loading a size of 0 is allowed. yes, zero. it's valid. it's iconic. don't @ me π
π RETURN π
returns the dictionary size, in bytes β and it's necessarily <= 64 KB. that's a hard cap, so plan accordingly. 64 KB is the ceiling and the ceiling is not moving π
β SEE ALSO β
lowkey a whole friend group here, so let me introduce everyone π«Ά
kernel file ./include/linux/lz4.h, plus:
LZ4_compressBound(9), LZ4_compress_default(9), LZ4_compress_fast(9), LZ4_compress_destSize(9), LZ4_decompress_fast(9), LZ4_decompress_safe(9), LZ4_decompress_safe_partial(9), LZ4_compress_HC(9), LZ4_resetStreamHC(9), LZ4_loadDictHC(9), LZ4_compress_HC_continue(9), LZ4_saveDictHC(9), LZ4_resetStream(9), LZ4_saveDict(9), LZ4_compress_fast_continue(9), LZ4_setStreamDecode(9), LZ4_decompress_safe_continue(9), LZ4_decompress_fast_continue(9), LZ4_decompress_safe_usingDict(9), LZ4_decompress_fast_usingDict(9)
reminder bestie:LZ4_loadDictandLZ4_loadDictHCare not the same function. one's the regular girlie, one's the HC version. don't mix them up π
and that's the page!! this one lives under ./include/linux, dating all the way to October 2026 β yeah, the future called, it's us πΈβ¨ mwah, go compress something cute π
π¦ 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