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/xz/Makefile.am | 1 - src/xz/hardware.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src/xz') diff --git a/src/xz/Makefile.am b/src/xz/Makefile.am index cc617053..08ac236f 100644 --- a/src/xz/Makefile.am +++ b/src/xz/Makefile.am @@ -32,7 +32,6 @@ xz_SOURCES = \ $(top_srcdir)/src/common/tuklib_open_stdxxx.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_cpucores.c if COND_W32 diff --git a/src/xz/hardware.c b/src/xz/hardware.c index d5f4b9b4..d91b4cee 100644 --- a/src/xz/hardware.c +++ b/src/xz/hardware.c @@ -11,7 +11,6 @@ /////////////////////////////////////////////////////////////////////////////// #include "private.h" -#include "tuklib_physmem.h" #include "tuklib_cpucores.h" @@ -66,7 +65,7 @@ hardware_memlimit_set_percentage(uint32_t percentage) assert(percentage > 0); assert(percentage <= 100); - uint64_t mem = tuklib_physmem(); + uint64_t mem = lzma_physmem(); // If we cannot determine the amount of RAM, use the assumption // defined by the configure script. -- cgit v1.2.3