SFDP: Fix sector map table allocation check
When passing an allocation size directly to `std::make_unique`,
`std::nothrow` is unavailable, so any failed allocation results in
an exception which we cannot catch because Mbed OS is compiled with
`-fno-exceptions`. To fix this, chain `std::make_unique` with
`new (std::nothrow)`, and the allocated `unique_ptr` retains the
`nullptr` property.
ls
1 parent 7a8ff5f commit 258125449270af8124fb9b05a303eb2e6d63e907
@Lingkai Dong Lingkai Dong authored on 8 Sep 2021
Showing 1 changed file
View
storage/blockdevice/source/SFDP.cpp