Update to 7-Zip Version 21.03

This commit is contained in:
Tino Reichardt
2021-08-25 22:33:02 +02:00
parent 27d965fd99
commit df06f31a42
90 changed files with 6003 additions and 1882 deletions

View File

@@ -0,0 +1,7 @@
// Sha256Prepare.cpp
#include "StdAfx.h"
#include "../../C/LzFind.h"
static struct CLzFindPrepare { CLzFindPrepare() { LzFindPrepare(); } } g_CLzFindPrepare;

View File

@@ -25,6 +25,19 @@ public:
operator const Byte *() const { return _data; }
size_t Size() const { return _size; }
void Alloc(size_t size)
{
if (!_data || size != _size)
{
::MidFree(_data);
_size = 0;
_data = NULL;
_data = (Byte *)::MidAlloc(size);
if (_data)
_size = size;
}
}
void AllocAtLeast(size_t size)
{
if (!_data || size > _size)
@@ -105,5 +118,22 @@ public:
}
};
/*
CMidAlignedBuffer must return aligned pointer.
- in Windows it uses CMidBuffer(): MidAlloc() : VirtualAlloc()
VirtualAlloc(): Memory allocated is automatically initialized to zero.
MidAlloc(0) returns NULL
- in non-Windows systems it uses g_AlignedAlloc.
g_AlignedAlloc::Alloc(size = 0) can return non NULL.
*/
typedef
#ifdef _WIN32
CMidBuffer
#else
CAlignedBuffer
#endif
CMidAlignedBuffer;
#endif