bootloader: Cleanup handling of LargeAllocations.

* Remove unused SetTo; clear Address/Size to 0 on init.

 * Free all LargeAllocations in heap_release. (This method isn't
   actually called by default before kernel entry, though, so
   it probably doesn't matter much.)

Change-Id: If038274adcd65adae527235d16860af659ef37b6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8439
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
This commit is contained in:
Augustin Cavalier 2024-10-09 22:29:52 -04:00 committed by waddlesplash
parent d1ef184af6
commit 359a04ba96

View File

@ -174,12 +174,8 @@ typedef IteratableSplayTree<FreeChunkTreeDefinition> FreeChunkTree;
struct LargeAllocation {
LargeAllocation()
{
}
void SetTo(void* address, size_t size)
{
fAddress = address;
fSize = size;
fAddress = NULL;
fSize = 0;
}
status_t Allocate(size_t size)
@ -387,6 +383,13 @@ FreeChunk::SetToAllocated(void* allocated)
void
heap_release(stage2_args* args)
{
LargeAllocation* allocation = sLargeAllocations.Clear(true);
while (allocation != NULL) {
LargeAllocation* next = allocation->HashNext();
allocation->Free();
allocation = next;
}
platform_release_heap(args, sHeapBase);
}