aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/lz/lz_encoder.h
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2014-05-25 21:45:56 +0300
committerLasse Collin <lasse.collin@tukaani.org>2014-05-25 21:45:56 +0300
commitda1718f266fcfc091e7bf08aae1bc986d0e6cc6b (patch)
tree343d14494eca3d36aa91782d78227cc6eceafc4f /src/liblzma/lz/lz_encoder.h
parentliblzma: Add the internal function lzma_alloc_zero(). (diff)
downloadxz-da1718f266fcfc091e7bf08aae1bc986d0e6cc6b.tar.xz
liblzma: Use lzma_alloc_zero() in LZ encoder initialization.
This avoids a memzero() call for a newly-allocated memory, which can be expensive when encoding small streams with an over-sized dictionary. To avoid using lzma_alloc_zero() for memory that doesn't need to be zeroed, lzma_mf.son is now allocated separately, which requires handling it separately in normalize() too. Thanks to Vincenzo Innocente for reporting the problem.
Diffstat (limited to '')
-rw-r--r--src/liblzma/lz/lz_encoder.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/liblzma/lz/lz_encoder.h b/src/liblzma/lz/lz_encoder.h
index d11d4a95..dad9c6b2 100644
--- a/src/liblzma/lz/lz_encoder.h
+++ b/src/liblzma/lz/lz_encoder.h
@@ -119,7 +119,7 @@ struct lzma_mf_s {
lzma_action action;
/// Number of elements in hash[]
- uint32_t hash_size_sum;
+ uint32_t hash_count;
/// Number of elements in son[]
uint32_t sons_count;