1
0
Fork 0
mirror of https://git.tukaani.org/xz.git synced 2024-04-04 12:36:23 +02:00
xz-archive/debug/memusage.c

52 lines
1.1 KiB
C
Raw Permalink Normal View History

2008-04-25 12:41:29 +02:00
///////////////////////////////////////////////////////////////////////////////
//
/// \file memusage.c
/// \brief Calculates memory usage using lzma_memory_usage()
//
// Author: Lasse Collin
2008-04-25 12:41:29 +02:00
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
2008-04-25 12:41:29 +02:00
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"
#include "lzma.h"
2008-04-25 12:41:29 +02:00
#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,
2008-04-25 12:41:29 +02:00
};
/*
lzma_options_filter filters[] = {
{ LZMA_FILTER_LZMA1,
2008-04-25 12:41:29 +02:00
(lzma_options_lzma *)&lzma_preset_lzma[6 - 1] },
{ UINT64_MAX, NULL }
};
*/
lzma_filter filters[] = {
{ LZMA_FILTER_LZMA1, &lzma },
2008-04-25 12:41:29 +02:00
{ 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));
2008-04-25 12:41:29 +02:00
return 0;
}