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 <[email protected]> Haiku-Format: Haiku-format Bot <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
d1ef184af6
commit
359a04ba96
@@ -174,12 +174,8 @@ typedef IteratableSplayTree<FreeChunkTreeDefinition> FreeChunkTree;
|
|||||||
struct LargeAllocation {
|
struct LargeAllocation {
|
||||||
LargeAllocation()
|
LargeAllocation()
|
||||||
{
|
{
|
||||||
}
|
fAddress = NULL;
|
||||||
|
fSize = 0;
|
||||||
void SetTo(void* address, size_t size)
|
|
||||||
{
|
|
||||||
fAddress = address;
|
|
||||||
fSize = size;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t Allocate(size_t size)
|
status_t Allocate(size_t size)
|
||||||
@@ -387,6 +383,13 @@ FreeChunk::SetToAllocated(void* allocated)
|
|||||||
void
|
void
|
||||||
heap_release(stage2_args* args)
|
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);
|
platform_release_heap(args, sHeapBase);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user