summaryrefslogtreecommitdiff
path: root/xdelta3/xdelta3.c
diff options
context:
space:
mode:
authorjosh.macdonald <jmacd@users.noreply.github.com>2009-11-08 17:31:16 +0000
committerjosh.macdonald <jmacd@users.noreply.github.com>2009-11-08 17:31:16 +0000
commit299d98b8710ae6e6b84ec78a759d91a15448a8b9 (patch)
tree153d9ddda5649ef749eb1ebf3a3021c5140d1b37 /xdelta3/xdelta3.c
parenta42182cd17787a521afa61b2cea719ae67b7d45b (diff)
Rewrote main_set_source() to delay deciding lru_size (effectively
option_srcwinsz) until after decompression state is known. Working but definitely needs more testing.
Diffstat (limited to 'xdelta3/xdelta3.c')
-rw-r--r--xdelta3/xdelta3.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/xdelta3/xdelta3.c b/xdelta3/xdelta3.c
index 100f058..2231fe1 100644
--- a/xdelta3/xdelta3.c
+++ b/xdelta3/xdelta3.c
@@ -2486,7 +2486,6 @@ inline
2486xoff_t xd3_source_eof(const xd3_source *src) 2486xoff_t xd3_source_eof(const xd3_source *src)
2487{ 2487{
2488 xoff_t r = (src->blksize * src->max_blkno) + (xoff_t)src->onlastblk; 2488 xoff_t r = (src->blksize * src->max_blkno) + (xoff_t)src->onlastblk;
2489 IF_DEBUG2 (DP(RINT "[src] source_size == %"Q"u\n", r));
2490 return r; 2489 return r;
2491} 2490}
2492 2491
@@ -2496,7 +2495,6 @@ usize_t xd3_bytes_on_srcblk (xd3_source *src, xoff_t blkno)
2496 usize_t r = (blkno == src->max_blkno ? 2495 usize_t r = (blkno == src->max_blkno ?
2497 src->onlastblk : 2496 src->onlastblk :
2498 src->blksize); 2497 src->blksize);
2499 IF_DEBUG2 (DP(RINT "[src] source last block size %u\n", r));
2500 return r; 2498 return r;
2501} 2499}
2502 2500
@@ -2773,6 +2771,11 @@ xd3_iopt_finish_encoding (xd3_stream *stream, xd3_rinst *inst)
2773 { 2771 {
2774 if ((ret = xd3_srcwin_setup (stream))) { return ret; } 2772 if ((ret = xd3_srcwin_setup (stream))) { return ret; }
2775 } 2773 }
2774 else
2775 {
2776 stream->srcwin_decided_early = (!stream->src->eof_known ||
2777 (stream->srcwin_cksum_pos < xd3_source_eof (stream->src)));
2778 }
2776 2779
2777 /* xtra field indicates the copy is from the source */ 2780 /* xtra field indicates the copy is from the source */
2778 if (inst->xtra) 2781 if (inst->xtra)
@@ -3688,6 +3691,7 @@ xd3_encode_reset (xd3_stream *stream)
3688 stream->src->srcbase = 0; 3691 stream->src->srcbase = 0;
3689 stream->src->srclen = 0; 3692 stream->src->srclen = 0;
3690 stream->srcwin_decided = 0; 3693 stream->srcwin_decided = 0;
3694 stream->srcwin_decided_early = 0;
3691 stream->match_minaddr = 0; 3695 stream->match_minaddr = 0;
3692 stream->match_maxaddr = 0; 3696 stream->match_maxaddr = 0;
3693 stream->taroff = 0; 3697 stream->taroff = 0;