diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:07:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:07:14 +0000 |
commit | a175314c3e5827eb193872241446f2f8f5c9d33c (patch) | |
tree | cd3d60ca99ae00829c52a6ca79150a5b6e62528b /storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/debug/memusage.c | |
parent | Initial commit. (diff) | |
download | mariadb-10.5-9e4947182e0b875da38088fdd168e775f473b8ad.tar.xz mariadb-10.5-9e4947182e0b875da38088fdd168e775f473b8ad.zip |
Adding upstream version 1:10.5.12.upstream/1%10.5.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/debug/memusage.c')
-rw-r--r-- | storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/debug/memusage.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/debug/memusage.c b/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/debug/memusage.c new file mode 100644 index 00000000..381357d3 --- /dev/null +++ b/storage/tokudb/PerconaFT/third_party/xz-4.999.9beta/debug/memusage.c @@ -0,0 +1,51 @@ +/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +// vim: expandtab:ts=8:sw=4:softtabstop=4: +/////////////////////////////////////////////////////////////////////////////// +// +/// \file memusage.c +/// \brief Calculates memory usage using lzma_memory_usage() +// +// Author: Lasse Collin +// +// This file has been put into the public domain. +// You can do whatever you want with this file. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "sysdefs.h" +#include "lzma.h" +#include <stdio.h> + +int +main(void) +{ + lzma_options_lzma lzma = { + .dict_size = (1U << 30) + (1U << 29), + .lc = 3, + .lp = 0, + .pb = 2, + .preset_dict = NULL, + .preset_dict_size = 0, + .mode = LZMA_MODE_NORMAL, + .nice_len = 48, + .mf = LZMA_MF_BT4, + .depth = 0, + }; + +/* + lzma_options_filter filters[] = { + { LZMA_FILTER_LZMA1, + (lzma_options_lzma *)&lzma_preset_lzma[6 - 1] }, + { UINT64_MAX, NULL } + }; +*/ + lzma_filter filters[] = { + { LZMA_FILTER_LZMA1, &lzma }, + { UINT64_MAX, NULL } + }; + + printf("Encoder: %10" PRIu64 " B\n", lzma_memusage_encoder(filters)); + printf("Decoder: %10" PRIu64 " B\n", lzma_memusage_decoder(filters)); + + return 0; +} |