Build: Fix a typo in autogen.sh
[xz/debian.git] / debug / memusage.c
blobb59289551febe8f2afc19f8fa08419d6bfdf6a55
1 // SPDX-License-Identifier: 0BSD
3 ///////////////////////////////////////////////////////////////////////////////
4 //
5 /// \file memusage.c
6 /// \brief Calculates memory usage using lzma_memory_usage()
7 //
8 // Author: Lasse Collin
9 //
10 ///////////////////////////////////////////////////////////////////////////////
12 #include "sysdefs.h"
13 #include "lzma.h"
14 #include <stdio.h>
16 int
17 main(void)
19 lzma_options_lzma lzma = {
20 .dict_size = (1U << 30) + (1U << 29),
21 .lc = 3,
22 .lp = 0,
23 .pb = 2,
24 .preset_dict = NULL,
25 .preset_dict_size = 0,
26 .mode = LZMA_MODE_NORMAL,
27 .nice_len = 48,
28 .mf = LZMA_MF_BT4,
29 .depth = 0,
33 lzma_options_filter filters[] = {
34 { LZMA_FILTER_LZMA1,
35 (lzma_options_lzma *)&lzma_preset_lzma[6 - 1] },
36 { UINT64_MAX, NULL }
39 lzma_filter filters[] = {
40 { LZMA_FILTER_LZMA1, &lzma },
41 { UINT64_MAX, NULL }
44 printf("Encoder: %10" PRIu64 " B\n",
45 lzma_raw_encoder_memusage(filters));
46 printf("Decoder: %10" PRIu64 " B\n",
47 lzma_raw_decoder_memusage(filters));
49 return 0;