Skip to content

Commit

Permalink
18.05 2018-04-30
Browse files Browse the repository at this point in the history
-------------------------
- The speed for LZMA/LZMA2 compressing was increased
    by 8% for fastest/fast compression levels and
    by 3% for normal/maximum compression levels.
- Previous versions of 7-Zip could work incorrectly in "Large memory pages" mode in
  Windows 10 because of some BUG with "Large Pages" in Windows 10.
  Now 7-Zip doesn't use "Large Pages" on Windows 10 up to revision 1709 (16299).
- The BUG was fixed in Lzma2Enc.c
    Lzma2Enc_Encode2() function worked incorretly,
      if (inStream == NULL) and the number of block threads is more than 1.

md5: 3216418e7f7c65a1ad62220c115b2147 lzma1805.7z
sha1: 04736658337f0ceff0bfee2c488ab88a709c9798 lzma1805.7z
  • Loading branch information
Igor Pavlov authored and jljusten committed Sep 9, 2018
1 parent b08f452 commit 781863c
Show file tree
Hide file tree
Showing 64 changed files with 2,130 additions and 1,260 deletions.
6 changes: 3 additions & 3 deletions C/7zVersion.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#define MY_VER_MAJOR 18
#define MY_VER_MINOR 03
#define MY_VER_MINOR 05
#define MY_VER_BUILD 0
#define MY_VERSION_NUMBERS "18.03 beta"
#define MY_VERSION_NUMBERS "18.05"
#define MY_VERSION MY_VERSION_NUMBERS

#ifdef MY_CPU_NAME
Expand All @@ -10,7 +10,7 @@
#define MY_VERSION_CPU MY_VERSION
#endif

#define MY_DATE "2018-03-04"
#define MY_DATE "2018-04-30"
#undef MY_COPYRIGHT
#undef MY_VERSION_COPYRIGHT_DATE
#define MY_AUTHOR_NAME "Igor Pavlov"
Expand Down
4 changes: 2 additions & 2 deletions C/Alloc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Alloc.c -- Memory allocation functions
2018-03-01 : Igor Pavlov : Public domain */
2018-04-27 : Igor Pavlov : Public domain */

#include "Precomp.h"

Expand Down Expand Up @@ -283,7 +283,7 @@ const ISzAlloc g_BigAlloc = { SzBigAlloc, SzBigFree };
#define MY_ALIGN_PTR_UP_PLUS(p, align) MY_ALIGN_PTR_DOWN(((char *)(p) + (align) + ADJUST_ALLOC_SIZE), align)


#if (_POSIX_C_SOURCE >= 200112L)
#if (_POSIX_C_SOURCE >= 200112L) && !defined(_WIN32)
#define USE_posix_memalign
#endif

Expand Down
10 changes: 5 additions & 5 deletions C/Bcj2.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Bcj2.c -- BCJ2 Decoder (Converter for x86 code)
2017-04-03 : Igor Pavlov : Public domain */
2018-04-28 : Igor Pavlov : Public domain */

#include "Precomp.h"

Expand Down Expand Up @@ -232,10 +232,10 @@ SRes Bcj2Dec_Decode(CBcj2Dec *p)

if (rem < 4)
{
SizeT i;
SetUi32(p->temp, val);
for (i = 0; i < rem; i++)
dest[i] = p->temp[i];
p->temp[0] = (Byte)val; if (rem > 0) dest[0] = (Byte)val; val >>= 8;
p->temp[1] = (Byte)val; if (rem > 1) dest[1] = (Byte)val; val >>= 8;
p->temp[2] = (Byte)val; if (rem > 2) dest[2] = (Byte)val; val >>= 8;
p->temp[3] = (Byte)val;
p->dest = dest + rem;
p->state = BCJ2_DEC_STATE_ORIG_0 + (unsigned)rem;
break;
Expand Down
3 changes: 1 addition & 2 deletions C/Bcj2Enc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Bcj2Enc.c -- BCJ2 Encoder (Converter for x86 code)
2017-04-03 : Igor Pavlov : Public domain */
2017-04-28 : Igor Pavlov : Public domain */

#include "Precomp.h"

Expand All @@ -12,7 +12,6 @@
#define PRF(x)
#endif

#include <windows.h>
#include <string.h>

#include "Bcj2.h"
Expand Down
14 changes: 8 additions & 6 deletions C/Lzma2Enc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Lzma2Enc.c -- LZMA2 Encoder
2018-02-08 : Igor Pavlov : Public domain */
2018-04-27 : Igor Pavlov : Public domain */

#include "Precomp.h"

Expand Down Expand Up @@ -369,7 +369,9 @@ typedef struct

ISeqOutStream *outStream;
Byte *outBuf;
size_t outBufSize;
size_t outBuf_Rem; /* remainder in outBuf */

size_t outBufSize; /* size of allocated outBufs[i] */
size_t outBufsDataSizes[MTCODER__BLOCKS_MAX];
Bool mtCoder_WasConstructed;
CMtCoder mtCoder;
Expand Down Expand Up @@ -699,10 +701,10 @@ static SRes Lzma2Enc_MtCallback_Write(void *pp, unsigned outBufIndex)
if (me->outStream)
return ISeqOutStream_Write(me->outStream, data, size) == size ? SZ_OK : SZ_ERROR_WRITE;

if (size > me->outBufSize)
if (size > me->outBuf_Rem)
return SZ_ERROR_OUTPUT_EOF;
memcpy(me->outBuf, data, size);
me->outBufSize -= size;
me->outBuf_Rem -= size;
me->outBuf += size;
return SZ_OK;
}
Expand Down Expand Up @@ -749,11 +751,11 @@ SRes Lzma2Enc_Encode2(CLzma2EncHandle pp,

p->outStream = outStream;
p->outBuf = NULL;
p->outBufSize = 0;
p->outBuf_Rem = 0;
if (!outStream)
{
p->outBuf = outBuf;
p->outBufSize = *outBufSize;
p->outBuf_Rem = *outBufSize;
*outBufSize = 0;
}

Expand Down
14 changes: 8 additions & 6 deletions C/LzmaDec.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* LzmaDec.h -- LZMA Decoder
2018-02-06 : Igor Pavlov : Public domain */
2018-04-21 : Igor Pavlov : Public domain */

#ifndef __LZMA_DEC_H
#define __LZMA_DEC_H
Expand All @@ -12,11 +12,13 @@ EXTERN_C_BEGIN
/* _LZMA_PROB32 can increase the speed on some CPUs,
but memory usage for CLzmaDec::probs will be doubled in that case */

typedef
#ifdef _LZMA_PROB32
#define CLzmaProb UInt32
UInt32
#else
#define CLzmaProb UInt16
UInt16
#endif
CLzmaProb;


/* ---------- LZMA Properties ---------- */
Expand Down Expand Up @@ -76,8 +78,8 @@ typedef struct
void LzmaDec_Init(CLzmaDec *p);

/* There are two types of LZMA streams:
0) Stream with end mark. That end mark adds about 6 bytes to compressed size.
1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */
- Stream with end mark. That end mark adds about 6 bytes to compressed size.
- Stream without end mark. You must know exact uncompressed size to decompress such stream. */

typedef enum
{
Expand Down Expand Up @@ -147,7 +149,7 @@ void LzmaDec_Free(CLzmaDec *p, ISzAllocPtr alloc);
You must work with CLzmaDec variables directly in this interface.
STEPS:
LzmaDec_Constr()
LzmaDec_Construct()
LzmaDec_Allocate()
for (each new stream)
{
Expand Down
Loading

0 comments on commit 781863c

Please sign in to comment.