4.47 beta

This commit is contained in:
Igor Pavlov
2007-05-27 00:00:00 +00:00
committed by Kornel Lesiński
parent c574fc0f4b
commit 0b33f700a6
10 changed files with 47 additions and 38 deletions

View File

@@ -420,8 +420,6 @@ static UInt32 NO_INLINE DecodeBlock2Rand(const UInt32 *tt, UInt32 blockSize, UIn
#ifdef COMPRESS_BZIP2_MT
static THREAD_FUNC_DECL MFThread(void *p) { ((CState *)p)->ThreadFunc(); return 0; }
CDecoder::CDecoder():
m_States(0)
{
@@ -439,7 +437,7 @@ HRes CDecoder::Create()
RINOK(CanProcessEvent.CreateIfNotCreated());
RINOK(CanStartWaitingEvent.CreateIfNotCreated());
if (m_States != 0 && m_NumThreadsPrev == NumThreads)
return true;
return S_OK;
Free();
MtMode = (NumThreads > 1);
m_NumThreadsPrev = NumThreads;
@@ -450,14 +448,13 @@ HRes CDecoder::Create()
return E_OUTOFMEMORY;
}
catch(...) { return E_OUTOFMEMORY; }
#ifdef COMPRESS_BZIP2_MT
for (UInt32 t = 0; t < NumThreads; t++)
{
CState &ti = m_States[t];
ti.Decoder = this;
if (MtMode)
{
HRes res = ti.Thread.Create(MFThread, &ti);
HRes res = ti.Create();
if (res != S_OK)
{
NumThreads = t;
@@ -466,7 +463,6 @@ HRes CDecoder::Create()
}
}
}
#endif
return S_OK;
}
@@ -528,7 +524,6 @@ HRESULT CDecoder::DecodeFile(bool &isBZ, ICompressProgressInfo *progress)
CState &s = m_States[t];
if (!s.Alloc())
return E_OUTOFMEMORY;
RINOK(s.Create());
s.StreamWasFinishedEvent.Reset();
s.WaitingWasStartedEvent.Reset();
s.CanWriteEvent.Reset();
@@ -649,6 +644,17 @@ STDMETHODIMP CDecoder::GetInStreamProcessedSize(UInt64 *value)
}
#ifdef COMPRESS_BZIP2_MT
static THREAD_FUNC_DECL MFThread(void *p) { ((CState *)p)->ThreadFunc(); return 0; }
HRes CState::Create()
{
RINOK(StreamWasFinishedEvent.CreateIfNotCreated());
RINOK(WaitingWasStartedEvent.CreateIfNotCreated());
RINOK(CanWriteEvent.CreateIfNotCreated());
return Thread.Create(MFThread, this);
}
void CState::FinishStream()
{
Decoder->StreamWasFinished1 = true;

View File

@@ -50,15 +50,10 @@ struct CState
Byte MtPad[1 << 8]; // It's pad for Multi-Threading. Must be >= Cache_Line_Size.
HRes Create();
void FinishStream();
void ThreadFunc();
HRes Create()
{
RINOK(StreamWasFinishedEvent.CreateIfNotCreated());
RINOK(WaitingWasStartedEvent.CreateIfNotCreated());
return CanWriteEvent.CreateIfNotCreated();
}
#endif
CState(): Counters(0) {}

View File

@@ -55,6 +55,20 @@ void CThreadInfo::Free()
}
#ifdef COMPRESS_BZIP2_MT
static THREAD_FUNC_DECL MFThread(void *threadCoderInfo)
{
return ((CThreadInfo *)threadCoderInfo)->ThreadFunc();
}
HRes CThreadInfo::Create()
{
RINOK(StreamWasFinishedEvent.Create());
RINOK(WaitingWasStartedEvent.Create());
RINOK(CanWriteEvent.Create());
return Thread.Create(MFThread, this);
}
void CThreadInfo::FinishStream(bool needLeave)
{
Encoder->StreamWasFinished = true;
@@ -111,10 +125,6 @@ DWORD CThreadInfo::ThreadFunc()
}
}
static THREAD_FUNC_DECL MFThread(void *threadCoderInfo)
{
return ((CThreadInfo *)threadCoderInfo)->ThreadFunc();
}
#endif
CEncoder::CEncoder():
@@ -157,7 +167,7 @@ HRes CEncoder::Create()
ti.Encoder = this;
if (MtMode)
{
HRes res = ti.Thread.Create(MFThread, &ti);
HRes res = ti.Create();
if (res != S_OK)
{
NumThreads = t;
@@ -735,7 +745,6 @@ HRESULT CEncoder::CodeReal(ISequentialInStream *inStream,
if (!ti.Alloc())
return E_OUTOFMEMORY;
RINOK(ti.Create());
}

View File

@@ -105,8 +105,6 @@ private:
int m_BlockIndex;
void FinishStream(bool needLeave);
void WriteBits2(UInt32 value, UInt32 numBits);
void WriteByte2(Byte b);
void WriteBit2(bool v);
@@ -130,12 +128,9 @@ public:
UInt64 m_PackSize;
Byte MtPad[1 << 8]; // It's pad for Multi-Threading. Must be >= Cache_Line_Size.
HRes Create()
{
RINOK(StreamWasFinishedEvent.Create());
RINOK(WaitingWasStartedEvent.Create());
return CanWriteEvent.Create();
}
HRes Create();
void FinishStream(bool needLeave);
DWORD ThreadFunc();
#endif
CThreadInfo(): m_BlockSorterIndex(0), m_Block(0) {}
@@ -144,7 +139,6 @@ public:
void Free();
HRESULT EncodeBlock3(UInt32 blockSize);
DWORD ThreadFunc();
};
class CEncoder :
@@ -230,7 +224,7 @@ public:
#ifdef COMPRESS_BZIP2_MT
MY_UNKNOWN_IMP2(ICompressSetCoderMt, ICompressSetCoderProperties)
#else
MY_UNKNOWN_IMP1(ICompressGetInStreamProcessedSize)
MY_UNKNOWN_IMP1(ICompressSetCoderProperties)
#endif
HRESULT CodeReal(ISequentialInStream *inStream,

View File

@@ -1,8 +1,8 @@
#define MY_VER_MAJOR 4
#define MY_VER_MINOR 46
#define MY_VER_BUILD 2
#define MY_VERSION "4.46 beta"
#define MY_7ZIP_VERSION "7-Zip 4.46 beta"
#define MY_DATE "2007-05-25"
#define MY_VER_MINOR 47
#define MY_VER_BUILD 0
#define MY_VERSION "4.47 beta"
#define MY_7ZIP_VERSION "7-Zip 4.47 beta"
#define MY_DATE "2007-05-27"
#define MY_COPYRIGHT "Copyright (c) 1999-2007 Igor Pavlov"
#define MY_VERSION_COPYRIGHT_DATE MY_VERSION " " MY_COPYRIGHT " " MY_DATE

View File

@@ -2,7 +2,7 @@
;Defines
!define VERSION_MAJOR 4
!define VERSION_MINOR 46
!define VERSION_MINOR 47
!define VERSION_POSTFIX_FULL " beta"
!ifdef WIN64
!ifdef IA64

View File

@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<?define VerMajor = "4" ?>
<?define VerMinor = "46" ?>
<?define VerMinor = "47" ?>
<?define VerBuild = "00" ?>
<?define MmVer = "$(var.VerMajor).$(var.VerMinor)" ?>
<?define MmHex = "0$(var.VerMajor)$(var.VerMinor)" ?>

View File

@@ -1,6 +1,11 @@
Sources history of the 7-Zip
----------------------------
Version 4.46 beta 2007-05-25
--------------------------------------
- CPP Synchronization objects now return HRes (error code) instead of bool.
Version 4.45 beta 2007-04-16
--------------------------------------
- 7-Zip now uses C version of CRC, so you must call CrcGenerateTable at

View File

@@ -1,4 +1,4 @@
LZMA SDK 4.44
LZMA SDK 4.46
-------------
LZMA SDK Copyright (C) 1999-2007 Igor Pavlov

View File

@@ -1,4 +1,4 @@
7-Zip 4.46 Sources
7-Zip 4.47 Sources
------------------
7-Zip is a file archiver for Windows 95/98/ME/NT/2000/2003/XP/Vista.