UnRAR: Use our own buffers and memory allocations

This commit is contained in:
philsmd
2020-09-08 10:46:44 +02:00
parent 9f380afa13
commit c9c03dd191
9 changed files with 44 additions and 15 deletions
+3 -2
View File
@@ -71,7 +71,7 @@ void SubAllocator::StopSubAllocator()
if ( SubAllocatorSize )
{
SubAllocatorSize=0;
free(HeapStart);
//free(HeapStart);
}
}
@@ -88,7 +88,8 @@ bool SubAllocator::StartSubAllocator(int SASize)
// units: one as reserve for HeapEnd overflow checks and another
// to provide the space to correctly align UnitsStart.
uint AllocSize=t/FIXED_UNIT_SIZE*UNIT_SIZE+2*UNIT_SIZE;
if ((HeapStart=(byte *)malloc(AllocSize)) == NULL)
//if ((HeapStart=(byte *)malloc(AllocSize)) == NULL)
if ((HeapStart=(byte *)HeapStartFixed) == NULL)
{
ErrHandler.MemoryError();
return false;