1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:17:44 +00:00

Kernel: Stop using the make<T> factory method in the Kernel

As make<T> is infallible, it really should not be used anywhere in the
Kernel. Instead replace with fallible `new (nothrow)` calls, that will
eventually be error-propagated.
This commit is contained in:
Idan Horowitz 2022-02-03 16:33:46 +02:00 committed by Andreas Kling
parent e5e7cb822a
commit 8289727fac
6 changed files with 7 additions and 7 deletions

View file

@ -367,7 +367,7 @@ UNMAP_AFTER_INIT void APIC::setup_ap_boot_environment()
// Allocate Processor structures for all APs and store the pointer to the data
m_ap_processor_info.resize(aps_to_enable);
for (size_t i = 0; i < aps_to_enable; i++)
m_ap_processor_info[i] = make<Processor>();
m_ap_processor_info[i] = adopt_nonnull_own_or_enomem(new (nothrow) Processor()).release_value_but_fixme_should_propagate_errors();
auto* ap_processor_info_array = &ap_stack_array[aps_to_enable];
for (size_t i = 0; i < aps_to_enable; i++) {
ap_processor_info_array[i] = FlatPtr(m_ap_processor_info[i].ptr());