Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1044)

Unified Diff: xz/debug/memusage.c

Issue 2869016: Add an unpatched version of xz, XZ Utils, to /trunk/deps/third_party (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xz/debug/known_sizes.c ('k') | xz/debug/repeat.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xz/debug/memusage.c
===================================================================
--- xz/debug/memusage.c (revision 0)
+++ xz/debug/memusage.c (revision 0)
@@ -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;
+}
Property changes on: xz/debug/memusage.c
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « xz/debug/known_sizes.c ('k') | xz/debug/repeat.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698