aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common/common.h
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-12-15 19:39:13 +0200
committerLasse Collin <lasse.collin@tukaani.org>2008-12-15 19:39:13 +0200
commit671a5adf1e844bfdd6fd327016c3c28694493158 (patch)
tree87f8e40cb30f2641b5b211e3bd3bec9ce084c95e /src/liblzma/common/common.h
parentThe LZMA2 decoder fix introduced a bug to LZ decoder, (diff)
downloadxz-671a5adf1e844bfdd6fd327016c3c28694493158.tar.xz
Bunch of liblzma API cleanups and fixes.
Diffstat (limited to '')
-rw-r--r--src/liblzma/common/common.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/liblzma/common/common.h b/src/liblzma/common/common.h
index 0ee8574c..ef8d0cbf 100644
--- a/src/liblzma/common/common.h
+++ b/src/liblzma/common/common.h
@@ -46,6 +46,12 @@
#define LZMA_BUFFER_SIZE 4096
+/// Starting value for memory usage estimates. Instead of calculating size
+/// of _every_ structure and taking into accont malloc() overhead etc. we
+/// add a base size to all memory usage estimates. It's not very accurate
+/// but should be easily good enough.
+#define LZMA_MEMUSAGE_BASE (UINT64_C(1) << 15)
+
/// Start of internal Filter ID space. These IDs must never be used
/// in Streams.
#define LZMA_FILTER_RESERVED_START (LZMA_VLI_C(1) << 62)
@@ -134,7 +140,8 @@ struct lzma_next_coder_s {
/// Pointer to function to get and/or change the memory usage limit.
/// If memlimit == 0, the limit is not changed.
- uint64_t (*memconfig)(lzma_coder *coder, uint64_t memlimit);
+ lzma_ret (*memconfig)(lzma_coder *coder, uint64_t *memusage,
+ uint64_t *old_memlimit, uint64_t new_memlimit);
};