Currently we pre-allocate around 128K of zstd state ahead of time,
keeping if for the whole daemon lifetime... Even if we don't need to
decompress any files. As mentioned by Dmitry:
Granted that tqftpserv handles only few files during the whole
lifetime and most of devices don't have swap, I think it's fine to
use non-context versions of the functions. Let's free the memory for
other software.
Swap ZSTD_decompressDCtx() for ZSTD_decompress() which will allocate and
free the state when needed.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
We need this to load compressed files from linux-firmware.
Closes https://github.com/linux-msm/tqftpserv/issues/19
Signed-off-by: Stefan Hansson <newbyte@postmarketos.org>
Tested-by: Nikita Travkin <nikita@trvn.ru>