preparations for getting rid of FZipLump

* allow ancient compression algorithms to be handled by OpenDecompressor.
* move FCompressedBuffer to fs_files.h
* use a mutex lock for 7z access because it cannot be made thread save otherwise.
This commit is contained in:
Christoph Oelckers 2023-12-12 20:17:59 +01:00
commit 39020f7f95
9 changed files with 298 additions and 81 deletions

View file

@ -108,8 +108,7 @@ void *StringPool::Alloc(size_t size)
{
Block *block;
size = ((size)+8) & ~7;
size = (size + 7) & ~7;
for (block = TopBlock; block != nullptr; block = block->NextBlock)
{
void *res = block->Alloc(size);
@ -124,7 +123,7 @@ void *StringPool::Alloc(size_t size)
const char* StringPool::Strdup(const char* str)
{
char* p = (char*)Alloc(strlen(str));
char* p = (char*)Alloc(strlen(str) + 1);
strcpy(p, str);
return p;
}