more bzip size savings (made it so our bzip2 can only decompress one thing at a time, though, which is fine cause thats what we use anyway)
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1207 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
a50df55cef
commit
4811f17832
2 changed files with 22 additions and 21 deletions
|
@ -443,15 +443,16 @@ int BZ_API(BZ2_bzCompressEnd) ( bz_stream *strm )
|
||||||
/*---------------------------------------------------*/
|
/*---------------------------------------------------*/
|
||||||
/*--- Decompression stuff ---*/
|
/*--- Decompression stuff ---*/
|
||||||
/*---------------------------------------------------*/
|
/*---------------------------------------------------*/
|
||||||
|
static DState local_state;
|
||||||
|
|
||||||
/*---------------------------------------------------*/
|
/*---------------------------------------------------*/
|
||||||
int BZ_API(BZ2_bzDecompressInit)
|
int BZ_API(BZ2_bzDecompressInit)
|
||||||
( bz_stream* strm)
|
( bz_stream* strm)
|
||||||
{
|
{
|
||||||
DState* s;
|
DState* s=&local_state;
|
||||||
|
|
||||||
s = BZALLOC( sizeof(DState) );
|
// s = BZALLOC( sizeof(DState) );
|
||||||
if (s == NULL) return BZ_MEM_ERROR;
|
// if (s == NULL) return BZ_MEM_ERROR;
|
||||||
s->strm = strm;
|
s->strm = strm;
|
||||||
strm->state = s;
|
strm->state = s;
|
||||||
s->state = BZ_X_BLKHDR_1;
|
s->state = BZ_X_BLKHDR_1;
|
||||||
|
@ -462,14 +463,14 @@ int BZ_API(BZ2_bzDecompressInit)
|
||||||
// strm->total_out_lo32 = 0;
|
// strm->total_out_lo32 = 0;
|
||||||
// strm->total_out_hi32 = 0;
|
// strm->total_out_hi32 = 0;
|
||||||
#ifdef NSIS_COMPRESS_BZIP2_SMALLMODE
|
#ifdef NSIS_COMPRESS_BZIP2_SMALLMODE
|
||||||
s->ll16 = BZALLOC( NSIS_COMPRESS_BZIP2_LEVEL*100000 * sizeof(UInt16) );
|
// s->ll16 = BZALLOC( NSIS_COMPRESS_BZIP2_LEVEL*100000 * sizeof(UInt16) );
|
||||||
s->ll4 = BZALLOC(
|
// s->ll4 = BZALLOC(
|
||||||
((1 + NSIS_COMPRESS_BZIP2_LEVEL*100000) >> 1) * sizeof(UChar)
|
// ((1 + NSIS_COMPRESS_BZIP2_LEVEL*100000) >> 1) * sizeof(UChar)
|
||||||
);
|
// );
|
||||||
if (s->ll16 == NULL || s->ll4 == NULL) return (BZ_MEM_ERROR);
|
// if (s->ll16 == NULL || s->ll4 == NULL) return (BZ_MEM_ERROR);
|
||||||
#else
|
#else
|
||||||
s->tt = BZALLOC( NSIS_COMPRESS_BZIP2_LEVEL * 100000 * sizeof(Int32) );
|
//s->tt = BZALLOC( NSIS_COMPRESS_BZIP2_LEVEL * 100000 * sizeof(Int32) );
|
||||||
if (s->tt == NULL) return (BZ_MEM_ERROR);
|
//if (s->tt == NULL) return (BZ_MEM_ERROR);
|
||||||
#endif
|
#endif
|
||||||
// s->currBlockNo = 0;
|
// s->currBlockNo = 0;
|
||||||
|
|
||||||
|
@ -721,7 +722,7 @@ void unRLE_obuf_to_output_FAST ( DState* s )
|
||||||
s->state_out_len = c_state_out_len;
|
s->state_out_len = c_state_out_len;
|
||||||
s->nblock_used = c_nblock_used;
|
s->nblock_used = c_nblock_used;
|
||||||
s->k0 = c_k0;
|
s->k0 = c_k0;
|
||||||
s->tt = c_tt;
|
// s->tt = c_tt;
|
||||||
s->tPos = c_tPos;
|
s->tPos = c_tPos;
|
||||||
s->strm->next_out = cs_next_out;
|
s->strm->next_out = cs_next_out;
|
||||||
s->strm->avail_out = cs_avail_out;
|
s->strm->avail_out = cs_avail_out;
|
||||||
|
@ -770,17 +771,17 @@ int BZ_API(BZ2_bzDecompress) ( bz_stream *strm )
|
||||||
/*---------------------------------------------------*/
|
/*---------------------------------------------------*/
|
||||||
int BZ_API(BZ2_bzDecompressEnd) ( bz_stream *strm )
|
int BZ_API(BZ2_bzDecompressEnd) ( bz_stream *strm )
|
||||||
{
|
{
|
||||||
DState* s;
|
// DState* s;
|
||||||
s = strm->state;
|
// s = strm->state;
|
||||||
|
|
||||||
#ifndef NSIS_COMPRESS_BZIP2_SMALLMODE
|
#ifndef NSIS_COMPRESS_BZIP2_SMALLMODE
|
||||||
BZFREE(s->tt);
|
// BZFREE(s->tt);
|
||||||
#else
|
#else
|
||||||
BZFREE(s->ll16);
|
// BZFREE(s->ll16);
|
||||||
BZFREE(s->ll4);
|
// BZFREE(s->ll4);
|
||||||
#endif
|
#endif
|
||||||
BZFREE(strm->state);
|
// BZFREE(strm->state);
|
||||||
strm->state = NULL;
|
//strm->state = NULL;
|
||||||
|
|
||||||
return BZ_OK;
|
return BZ_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -351,11 +351,11 @@ typedef
|
||||||
|
|
||||||
#ifndef NSIS_COMPRESS_BZIP2_SMALLMODE
|
#ifndef NSIS_COMPRESS_BZIP2_SMALLMODE
|
||||||
/* for undoing the Burrows-Wheeler transform (FAST) */
|
/* for undoing the Burrows-Wheeler transform (FAST) */
|
||||||
UInt32 *tt;
|
UInt32 tt[ NSIS_COMPRESS_BZIP2_LEVEL * 100000 ];
|
||||||
#else
|
#else
|
||||||
/* for undoing the Burrows-Wheeler transform (SMALL) */
|
/* for undoing the Burrows-Wheeler transform (SMALL) */
|
||||||
UInt16 *ll16;
|
UInt16 ll16 [ NSIS_COMPRESS_BZIP2_LEVEL*100000 ];
|
||||||
UChar *ll4;
|
UChar ll4 [((1 + NSIS_COMPRESS_BZIP2_LEVEL*100000) >> 1) ];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* stored and calculated CRCs */
|
/* stored and calculated CRCs */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue