aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common/stream_buffer_encoder.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2009-12-31 22:45:53 +0200
committerLasse Collin <lasse.collin@tukaani.org>2009-12-31 22:45:53 +0200
commit1a7ec87c8ee61dfc2e496d2e1fb7ab0939804691 (patch)
tree3ed5d9cc0c7629c1ca09a5df1d1193b90815cc88 /src/liblzma/common/stream_buffer_encoder.c
parentRemove c-format tag in cs.po. (diff)
downloadxz-1a7ec87c8ee61dfc2e496d2e1fb7ab0939804691.tar.xz
Revised the Index handling code.
This breaks API and ABI but most apps are not affected since most apps don't use this part of the API. You will get a compile error if you are using anything that got broken. Summary of changes: - Ability to store Stream Flags, which are needed for random-access reading in multi-Stream files. - Separate function to set size of Stream Padding. - Iterator structure makes it possible to read the same lzma_index from multiple threads at the same time. - A lot faster code to locate Blocks. - Removed lzma_index_equal() without adding anything to replace it. I don't know what it should do exactly with the new features and what actually needs this function in the first place other than test_index.c, which now has its own code to compare lzma_indexes.
Diffstat (limited to '')
-rw-r--r--src/liblzma/common/stream_buffer_encoder.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/liblzma/common/stream_buffer_encoder.c b/src/liblzma/common/stream_buffer_encoder.c
index dd94c22a..bbafaa6d 100644
--- a/src/liblzma/common/stream_buffer_encoder.c
+++ b/src/liblzma/common/stream_buffer_encoder.c
@@ -94,11 +94,11 @@ lzma_stream_buffer_encode(lzma_filter *filters, lzma_check check,
// Index
{
// Create an Index with one Record.
- lzma_index *i = lzma_index_init(NULL, NULL);
+ lzma_index *i = lzma_index_init(allocator);
if (i == NULL)
return LZMA_MEM_ERROR;
- lzma_ret ret = lzma_index_append(i, NULL,
+ lzma_ret ret = lzma_index_append(i, allocator,
lzma_block_unpadded_size(&block),
block.uncompressed_size);
@@ -111,7 +111,7 @@ lzma_stream_buffer_encode(lzma_filter *filters, lzma_check check,
stream_flags.backward_size = lzma_index_size(i);
}
- lzma_index_end(i, NULL);
+ lzma_index_end(i, allocator);
if (ret != LZMA_OK)
return ret;