From 93e418562cf127a9171e87bcd4e9af8e1bfcdae4 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Sun, 15 Nov 2009 12:40:17 +0200 Subject: Add lzma_physmem(). I had hoped to keep liblzma as purely a compression library as possible (e.g. file I/O will go into a different library), but it seems that applications linking agaisnt liblzma need some way to determine the memory usage limit, and knowing the amount of RAM is one reasonable way to help making such decisions. Thanks to Jonathan Nieder for the original patch. --- src/xzdec/Makefile.am | 6 ++---- src/xzdec/xzdec.c | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'src/xzdec') diff --git a/src/xzdec/Makefile.am b/src/xzdec/Makefile.am index 9a1b4342..ad487721 100644 --- a/src/xzdec/Makefile.am +++ b/src/xzdec/Makefile.am @@ -17,8 +17,7 @@ bin_PROGRAMS = xzdec lzmadec xzdec_SOURCES = \ xzdec.c \ $(top_srcdir)/src/common/tuklib_progname.c \ - $(top_srcdir)/src/common/tuklib_exit.c \ - $(top_srcdir)/src/common/tuklib_physmem.c + $(top_srcdir)/src/common/tuklib_exit.c if COND_W32 xzdec_SOURCES += xzdec_w32res.rc @@ -43,8 +42,7 @@ xzdec_LDADD += $(LTLIBINTL) lzmadec_SOURCES = \ xzdec.c \ $(top_srcdir)/src/common/tuklib_progname.c \ - $(top_srcdir)/src/common/tuklib_exit.c \ - $(top_srcdir)/src/common/tuklib_physmem.c + $(top_srcdir)/src/common/tuklib_exit.c if COND_W32 lzmadec_SOURCES += lzmadec_w32res.rc diff --git a/src/xzdec/xzdec.c b/src/xzdec/xzdec.c index 4f40f1d6..0abccebb 100644 --- a/src/xzdec/xzdec.c +++ b/src/xzdec/xzdec.c @@ -21,7 +21,6 @@ #include "getopt.h" #include "tuklib_progname.h" #include "tuklib_exit.h" -#include "tuklib_physmem.h" #ifdef TUKLIB_DOSLIKE # include @@ -104,7 +103,7 @@ version(void) static void memlimit_set_percentage(uint32_t percentage) { - uint64_t mem = tuklib_physmem(); + uint64_t mem = lzma_physmem(); // If we cannot determine the amount of RAM, use the assumption // set by the configure script. -- cgit v1.2.3