summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <proyvind@moondrake.org>2015-08-12 03:12:06 +0200
committerpark <sk7.park@samsung.com>2017-01-02 02:37:52 -0800
commit2b208642be85a9b03250c6ac403d1bbd1b293336 (patch)
treebe01155006d48d99294a9ff6c672c07560b52bcc
parentcae7c0feb50a85e859b5899aa12b86ac88f22533 (diff)
downloadrpm-2b208642be85a9b03250c6ac403d1bbd1b293336.tar.gz
rpm-2b208642be85a9b03250c6ac403d1bbd1b293336.tar.bz2
rpm-2b208642be85a9b03250c6ac403d1bbd1b293336.zip
add support for setting xz memlimit
Change-Id: If7513a85c77692983bc2cb948f5b92eea3b304d8
-rw-r--r--rpmio/rpmio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c
index 60da8bea1..0c1a674dc 100644
--- a/rpmio/rpmio.c
+++ b/rpmio/rpmio.c
@@ -897,6 +897,7 @@ static LZFILE *lzopen_internal(const char *path, const char *mode, int fd, int x
LZFILE *lzfile;
lzma_ret ret;
lzma_stream init_strm = LZMA_STREAM_INIT;
+ uint64_t mem_limit = rpmExpandNumeric("%{_xz_memlimit}");
for (; *mode; mode++) {
if (*mode == 'w')
@@ -931,7 +932,7 @@ static LZFILE *lzopen_internal(const char *path, const char *mode, int fd, int x
ret = lzma_alone_encoder(&lzfile->strm, &options);
}
} else { /* lzma_easy_decoder_memusage(level) is not ready yet, use hardcoded limit for now */
- ret = lzma_auto_decoder(&lzfile->strm, 100<<20, 0);
+ ret = lzma_auto_decoder(&lzfile->strm, mem_limit ? mem_limit : 100<<20, 0);
}
if (ret != LZMA_OK) {
switch (ret) {