From 70fe07f83a5dd3d3fa6f571e7212be1d36a58f5c Mon Sep 17 00:00:00 2001 From: vit9696 Date: Mon, 4 Nov 2019 20:39:44 +0300 Subject: [PATCH] OcBootManagementLib: Disable experimental ballooning allocation Currently this feature does not seem to be benefitial, as on low memory machines it prevents booting from recovery by allocating too much memory instead of actually improving the situation. Perhaps this feature is to be removed in the future. --- Library/OcBootManagementLib/DefaultEntryChoice.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Library/OcBootManagementLib/DefaultEntryChoice.c b/Library/OcBootManagementLib/DefaultEntryChoice.c index ac12a6af..cffb016e 100644 --- a/Library/OcBootManagementLib/DefaultEntryChoice.c +++ b/Library/OcBootManagementLib/DefaultEntryChoice.c @@ -905,9 +905,12 @@ InternalLoadBootEntry ( // Assume that DMG load requires a lot of memory. // UseBallooning = Context->BalloonAllocator != NULL; + +#ifdef OC_ENABLE_BALLOONING if (UseBallooning) { Context->BalloonAllocator (TRUE); } +#endif DmgLoadContext->DevicePath = BootEntry->DevicePath; DevicePath = InternalLoadDmg ( @@ -917,9 +920,11 @@ InternalLoadBootEntry ( UseBallooning ); if (DevicePath == NULL) { +#ifdef OC_ENABLE_BALLOONING if (UseBallooning) { Context->BalloonAllocator (FALSE); } +#endif return EFI_UNSUPPORTED; } } else if (BootEntry->Type == OcBootCustom && BootEntry->DevicePath == NULL) { @@ -1023,9 +1028,11 @@ InternalLoadBootEntry ( } } else { InternalUnloadDmg (DmgLoadContext); +#ifdef OC_ENABLE_BALLOONING if (UseBallooning) { Context->BalloonAllocator (FALSE); } +#endif } return Status;