diff options
author | Karl Berry <karl@freefriends.org> | 2010-06-13 22:23:34 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-06-13 22:23:34 +0000 |
commit | f06e0d7e9489163b444e1381a9e670ed1789725d (patch) | |
tree | d838b80e2b32cea0554b0a238b8344fe8059b4ad /Build/source/extra/xz/debug/memusage.c | |
parent | 686b7eed06371a6d8721b657c0e77207732172dc (diff) |
rename to plain xz for the sake of diffs and consistent path in doc
git-svn-id: svn://tug.org/texlive/trunk@18954 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/extra/xz/debug/memusage.c')
-rw-r--r-- | Build/source/extra/xz/debug/memusage.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Build/source/extra/xz/debug/memusage.c b/Build/source/extra/xz/debug/memusage.c new file mode 100644 index 00000000000..bd72b5a22c6 --- /dev/null +++ b/Build/source/extra/xz/debug/memusage.c @@ -0,0 +1,51 @@ +/////////////////////////////////////////////////////////////////////////////// +// +/// \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_raw_encoder_memusage(filters)); + printf("Decoder: %10" PRIu64 " B\n", + lzma_raw_decoder_memusage(filters)); + + return 0; +} |