Deallocation of all memory in ContiguousFreeList can be done without using parent.deallocateAll. Buffer used by ContiguousFreeList is always allocated by parent so deallocateAll it should be enought to implement deallocateAll.
If I understand everything properly such an implementation would be enought:
bool deallocateAll()
{
bool result = parent.deallocate(support);
allocated = 0;
return result;
}
I am not sure but current implementation might be wrong because it is calling parent.deallocateAll() and parent might have been used to allocate some other data not only buffer for ContiguousFreeList.
Comment #1 by robert.schadek — 2024-12-01T16:33:59Z