aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-10-16 14:07:41 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-10-16 14:07:41 +0000
commit686b0ef7d83f11741c21aae292558671e5298799 (patch)
treeb70e2f3dde947681d9329abe6ed1a03de81e6be9
parent008eda2c548045b4918ebb2e132940a790a84201 (diff)
downloadbusybox-w32-686b0ef7d83f11741c21aae292558671e5298799.tar.gz
busybox-w32-686b0ef7d83f11741c21aae292558671e5298799.tar.bz2
busybox-w32-686b0ef7d83f11741c21aae292558671e5298799.zip
bzip2: move state pointer to the offset 0 (smaller code)
ifdef out DecompressEnd if FEATURE_CLEAN_UP is not seleted fallbackSort 1655 1672 +17 mainSort 2447 2458 +11 bzip2_main 109 119 +10 .rodata 123466 123469 +3 generateMTFValues 433 435 +2 handle_compress 355 356 +1 BZ2_bzCompress 79 78 -1 prepare_new_block 55 48 -7 compressStream 547 503 -44 sendMTFValues 2225 2140 -85 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 6/4 up/down: 44/-137) Total: -93 bytes text data bss dec hex filename 676421 2538 12104 691063 a8b77 busybox_old 676328 2538 12104 690970 a8b1a busybox_unstripped
-rw-r--r--archival/bz/bzlib.c2
-rw-r--r--archival/bz/bzlib.h4
-rw-r--r--archival/bzip2.c2
3 files changed, 7 insertions, 1 deletions
diff --git a/archival/bz/bzlib.c b/archival/bz/bzlib.c
index f27050a3c..cdb596cb1 100644
--- a/archival/bz/bzlib.c
+++ b/archival/bz/bzlib.c
@@ -363,6 +363,7 @@ case_BZ_M_FLUSHING:
363 363
364 364
365/*---------------------------------------------------*/ 365/*---------------------------------------------------*/
366#if ENABLE_FEATURE_CLEAN_UP
366static 367static
367void BZ2_bzCompressEnd(bz_stream *strm) 368void BZ2_bzCompressEnd(bz_stream *strm)
368{ 369{
@@ -375,6 +376,7 @@ void BZ2_bzCompressEnd(bz_stream *strm)
375 free(s->crc32table); 376 free(s->crc32table);
376 free(strm->state); 377 free(strm->state);
377} 378}
379#endif
378 380
379 381
380/*---------------------------------------------------*/ 382/*---------------------------------------------------*/
diff --git a/archival/bz/bzlib.h b/archival/bz/bzlib.h
index 602aab926..1bb811c4a 100644
--- a/archival/bz/bzlib.h
+++ b/archival/bz/bzlib.h
@@ -43,20 +43,22 @@ in the file LICENSE.
43#define BZ_CONFIG_ERROR (-9) 43#define BZ_CONFIG_ERROR (-9)
44 44
45typedef struct bz_stream { 45typedef struct bz_stream {
46 void *state;
46 char *next_in; 47 char *next_in;
47 char *next_out; 48 char *next_out;
48 unsigned avail_in; 49 unsigned avail_in;
49 unsigned avail_out; 50 unsigned avail_out;
50 /*unsigned long long total_in;*/ 51 /*unsigned long long total_in;*/
51 unsigned long long total_out; 52 unsigned long long total_out;
52 void *state;
53} bz_stream; 53} bz_stream;
54 54
55/*-- Core (low-level) library functions --*/ 55/*-- Core (low-level) library functions --*/
56 56
57static void BZ2_bzCompressInit(bz_stream *strm, int blockSize100k); 57static void BZ2_bzCompressInit(bz_stream *strm, int blockSize100k);
58static int BZ2_bzCompress(bz_stream *strm, int action); 58static int BZ2_bzCompress(bz_stream *strm, int action);
59#if ENABLE_FEATURE_CLEAN_UP
59static void BZ2_bzCompressEnd(bz_stream *strm); 60static void BZ2_bzCompressEnd(bz_stream *strm);
61#endif
60 62
61/*-------------------------------------------------------------*/ 63/*-------------------------------------------------------------*/
62/*--- end bzlib.h ---*/ 64/*--- end bzlib.h ---*/
diff --git a/archival/bzip2.c b/archival/bzip2.c
index c750a056f..67df14416 100644
--- a/archival/bzip2.c
+++ b/archival/bzip2.c
@@ -116,7 +116,9 @@ USE_DESKTOP(long long) int bz_write_tail(bz_stream *strm, void *wbuf)
116 116
117 total = 0 USE_DESKTOP( + strm->total_out ); 117 total = 0 USE_DESKTOP( + strm->total_out );
118 err: 118 err:
119#if ENABLE_FEATURE_CLEAN_UP
119 BZ2_bzCompressEnd(strm); 120 BZ2_bzCompressEnd(strm);
121#endif
120 return total; 122 return total;
121} 123}
122 124