diff --git a/boards.txt b/boards.txt index ba4c7e6e0..afd7fb026 100644 --- a/boards.txt +++ b/boards.txt @@ -49,10 +49,7 @@ generic.menu.vt.heap=Heap generic.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM generic.menu.vt.iram=IRAM generic.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -generic.menu.exception.legacy=Legacy (new can return nullptr) -generic.menu.exception.legacy.build.exception_flags=-fno-exceptions -generic.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -generic.menu.exception.disabled=Disabled (new can abort) +generic.menu.exception.disabled=Disabled (new aborts on oom) generic.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT generic.menu.exception.disabled.build.stdcpp_lib=-lstdc++ generic.menu.exception.enabled=Enabled @@ -521,10 +518,7 @@ esp8285.menu.vt.heap=Heap esp8285.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM esp8285.menu.vt.iram=IRAM esp8285.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -esp8285.menu.exception.legacy=Legacy (new can return nullptr) -esp8285.menu.exception.legacy.build.exception_flags=-fno-exceptions -esp8285.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -esp8285.menu.exception.disabled=Disabled (new can abort) +esp8285.menu.exception.disabled=Disabled (new aborts on oom) esp8285.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT esp8285.menu.exception.disabled.build.stdcpp_lib=-lstdc++ esp8285.menu.exception.enabled=Enabled @@ -859,10 +853,7 @@ espduino.menu.vt.heap=Heap espduino.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM espduino.menu.vt.iram=IRAM espduino.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -espduino.menu.exception.legacy=Legacy (new can return nullptr) -espduino.menu.exception.legacy.build.exception_flags=-fno-exceptions -espduino.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -espduino.menu.exception.disabled=Disabled (new can abort) +espduino.menu.exception.disabled=Disabled (new aborts on oom) espduino.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT espduino.menu.exception.disabled.build.stdcpp_lib=-lstdc++ espduino.menu.exception.enabled=Enabled @@ -1048,10 +1039,7 @@ huzzah.menu.vt.heap=Heap huzzah.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM huzzah.menu.vt.iram=IRAM huzzah.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -huzzah.menu.exception.legacy=Legacy (new can return nullptr) -huzzah.menu.exception.legacy.build.exception_flags=-fno-exceptions -huzzah.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -huzzah.menu.exception.disabled=Disabled (new can abort) +huzzah.menu.exception.disabled=Disabled (new aborts on oom) huzzah.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT huzzah.menu.exception.disabled.build.stdcpp_lib=-lstdc++ huzzah.menu.exception.enabled=Enabled @@ -1238,10 +1226,7 @@ inventone.menu.vt.heap=Heap inventone.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM inventone.menu.vt.iram=IRAM inventone.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -inventone.menu.exception.legacy=Legacy (new can return nullptr) -inventone.menu.exception.legacy.build.exception_flags=-fno-exceptions -inventone.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -inventone.menu.exception.disabled=Disabled (new can abort) +inventone.menu.exception.disabled=Disabled (new aborts on oom) inventone.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT inventone.menu.exception.disabled.build.stdcpp_lib=-lstdc++ inventone.menu.exception.enabled=Enabled @@ -1428,10 +1413,7 @@ cw01.menu.vt.heap=Heap cw01.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM cw01.menu.vt.iram=IRAM cw01.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -cw01.menu.exception.legacy=Legacy (new can return nullptr) -cw01.menu.exception.legacy.build.exception_flags=-fno-exceptions -cw01.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -cw01.menu.exception.disabled=Disabled (new can abort) +cw01.menu.exception.disabled=Disabled (new aborts on oom) cw01.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT cw01.menu.exception.disabled.build.stdcpp_lib=-lstdc++ cw01.menu.exception.enabled=Enabled @@ -1621,10 +1603,7 @@ espresso_lite_v1.menu.vt.heap=Heap espresso_lite_v1.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM espresso_lite_v1.menu.vt.iram=IRAM espresso_lite_v1.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -espresso_lite_v1.menu.exception.legacy=Legacy (new can return nullptr) -espresso_lite_v1.menu.exception.legacy.build.exception_flags=-fno-exceptions -espresso_lite_v1.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -espresso_lite_v1.menu.exception.disabled=Disabled (new can abort) +espresso_lite_v1.menu.exception.disabled=Disabled (new aborts on oom) espresso_lite_v1.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT espresso_lite_v1.menu.exception.disabled.build.stdcpp_lib=-lstdc++ espresso_lite_v1.menu.exception.enabled=Enabled @@ -1814,10 +1793,7 @@ espresso_lite_v2.menu.vt.heap=Heap espresso_lite_v2.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM espresso_lite_v2.menu.vt.iram=IRAM espresso_lite_v2.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -espresso_lite_v2.menu.exception.legacy=Legacy (new can return nullptr) -espresso_lite_v2.menu.exception.legacy.build.exception_flags=-fno-exceptions -espresso_lite_v2.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -espresso_lite_v2.menu.exception.disabled=Disabled (new can abort) +espresso_lite_v2.menu.exception.disabled=Disabled (new aborts on oom) espresso_lite_v2.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT espresso_lite_v2.menu.exception.disabled.build.stdcpp_lib=-lstdc++ espresso_lite_v2.menu.exception.enabled=Enabled @@ -2007,10 +1983,7 @@ phoenix_v1.menu.vt.heap=Heap phoenix_v1.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM phoenix_v1.menu.vt.iram=IRAM phoenix_v1.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -phoenix_v1.menu.exception.legacy=Legacy (new can return nullptr) -phoenix_v1.menu.exception.legacy.build.exception_flags=-fno-exceptions -phoenix_v1.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -phoenix_v1.menu.exception.disabled=Disabled (new can abort) +phoenix_v1.menu.exception.disabled=Disabled (new aborts on oom) phoenix_v1.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT phoenix_v1.menu.exception.disabled.build.stdcpp_lib=-lstdc++ phoenix_v1.menu.exception.enabled=Enabled @@ -2200,10 +2173,7 @@ phoenix_v2.menu.vt.heap=Heap phoenix_v2.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM phoenix_v2.menu.vt.iram=IRAM phoenix_v2.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -phoenix_v2.menu.exception.legacy=Legacy (new can return nullptr) -phoenix_v2.menu.exception.legacy.build.exception_flags=-fno-exceptions -phoenix_v2.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -phoenix_v2.menu.exception.disabled=Disabled (new can abort) +phoenix_v2.menu.exception.disabled=Disabled (new aborts on oom) phoenix_v2.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT phoenix_v2.menu.exception.disabled.build.stdcpp_lib=-lstdc++ phoenix_v2.menu.exception.enabled=Enabled @@ -2393,10 +2363,7 @@ nodemcu.menu.vt.heap=Heap nodemcu.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM nodemcu.menu.vt.iram=IRAM nodemcu.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -nodemcu.menu.exception.legacy=Legacy (new can return nullptr) -nodemcu.menu.exception.legacy.build.exception_flags=-fno-exceptions -nodemcu.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -nodemcu.menu.exception.disabled=Disabled (new can abort) +nodemcu.menu.exception.disabled=Disabled (new aborts on oom) nodemcu.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT nodemcu.menu.exception.disabled.build.stdcpp_lib=-lstdc++ nodemcu.menu.exception.enabled=Enabled @@ -2583,10 +2550,7 @@ nodemcuv2.menu.vt.heap=Heap nodemcuv2.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM nodemcuv2.menu.vt.iram=IRAM nodemcuv2.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -nodemcuv2.menu.exception.legacy=Legacy (new can return nullptr) -nodemcuv2.menu.exception.legacy.build.exception_flags=-fno-exceptions -nodemcuv2.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -nodemcuv2.menu.exception.disabled=Disabled (new can abort) +nodemcuv2.menu.exception.disabled=Disabled (new aborts on oom) nodemcuv2.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT nodemcuv2.menu.exception.disabled.build.stdcpp_lib=-lstdc++ nodemcuv2.menu.exception.enabled=Enabled @@ -2777,10 +2741,7 @@ modwifi.menu.vt.heap=Heap modwifi.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM modwifi.menu.vt.iram=IRAM modwifi.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -modwifi.menu.exception.legacy=Legacy (new can return nullptr) -modwifi.menu.exception.legacy.build.exception_flags=-fno-exceptions -modwifi.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -modwifi.menu.exception.disabled=Disabled (new can abort) +modwifi.menu.exception.disabled=Disabled (new aborts on oom) modwifi.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT modwifi.menu.exception.disabled.build.stdcpp_lib=-lstdc++ modwifi.menu.exception.enabled=Enabled @@ -2987,10 +2948,7 @@ thing.menu.vt.heap=Heap thing.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM thing.menu.vt.iram=IRAM thing.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -thing.menu.exception.legacy=Legacy (new can return nullptr) -thing.menu.exception.legacy.build.exception_flags=-fno-exceptions -thing.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -thing.menu.exception.disabled=Disabled (new can abort) +thing.menu.exception.disabled=Disabled (new aborts on oom) thing.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT thing.menu.exception.disabled.build.stdcpp_lib=-lstdc++ thing.menu.exception.enabled=Enabled @@ -3177,10 +3135,7 @@ thingdev.menu.vt.heap=Heap thingdev.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM thingdev.menu.vt.iram=IRAM thingdev.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -thingdev.menu.exception.legacy=Legacy (new can return nullptr) -thingdev.menu.exception.legacy.build.exception_flags=-fno-exceptions -thingdev.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -thingdev.menu.exception.disabled=Disabled (new can abort) +thingdev.menu.exception.disabled=Disabled (new aborts on oom) thingdev.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT thingdev.menu.exception.disabled.build.stdcpp_lib=-lstdc++ thingdev.menu.exception.enabled=Enabled @@ -3367,10 +3322,7 @@ blynk.menu.vt.heap=Heap blynk.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM blynk.menu.vt.iram=IRAM blynk.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -blynk.menu.exception.legacy=Legacy (new can return nullptr) -blynk.menu.exception.legacy.build.exception_flags=-fno-exceptions -blynk.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -blynk.menu.exception.disabled=Disabled (new can abort) +blynk.menu.exception.disabled=Disabled (new aborts on oom) blynk.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT blynk.menu.exception.disabled.build.stdcpp_lib=-lstdc++ blynk.menu.exception.enabled=Enabled @@ -3557,10 +3509,7 @@ esp210.menu.vt.heap=Heap esp210.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM esp210.menu.vt.iram=IRAM esp210.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -esp210.menu.exception.legacy=Legacy (new can return nullptr) -esp210.menu.exception.legacy.build.exception_flags=-fno-exceptions -esp210.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -esp210.menu.exception.disabled=Disabled (new can abort) +esp210.menu.exception.disabled=Disabled (new aborts on oom) esp210.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT esp210.menu.exception.disabled.build.stdcpp_lib=-lstdc++ esp210.menu.exception.enabled=Enabled @@ -3747,10 +3696,7 @@ d1_mini.menu.vt.heap=Heap d1_mini.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM d1_mini.menu.vt.iram=IRAM d1_mini.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -d1_mini.menu.exception.legacy=Legacy (new can return nullptr) -d1_mini.menu.exception.legacy.build.exception_flags=-fno-exceptions -d1_mini.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -d1_mini.menu.exception.disabled=Disabled (new can abort) +d1_mini.menu.exception.disabled=Disabled (new aborts on oom) d1_mini.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT d1_mini.menu.exception.disabled.build.stdcpp_lib=-lstdc++ d1_mini.menu.exception.enabled=Enabled @@ -3937,10 +3883,7 @@ d1_mini_pro.menu.vt.heap=Heap d1_mini_pro.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM d1_mini_pro.menu.vt.iram=IRAM d1_mini_pro.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -d1_mini_pro.menu.exception.legacy=Legacy (new can return nullptr) -d1_mini_pro.menu.exception.legacy.build.exception_flags=-fno-exceptions -d1_mini_pro.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -d1_mini_pro.menu.exception.disabled=Disabled (new can abort) +d1_mini_pro.menu.exception.disabled=Disabled (new aborts on oom) d1_mini_pro.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT d1_mini_pro.menu.exception.disabled.build.stdcpp_lib=-lstdc++ d1_mini_pro.menu.exception.enabled=Enabled @@ -4110,10 +4053,7 @@ d1_mini_lite.menu.vt.heap=Heap d1_mini_lite.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM d1_mini_lite.menu.vt.iram=IRAM d1_mini_lite.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -d1_mini_lite.menu.exception.legacy=Legacy (new can return nullptr) -d1_mini_lite.menu.exception.legacy.build.exception_flags=-fno-exceptions -d1_mini_lite.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -d1_mini_lite.menu.exception.disabled=Disabled (new can abort) +d1_mini_lite.menu.exception.disabled=Disabled (new aborts on oom) d1_mini_lite.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT d1_mini_lite.menu.exception.disabled.build.stdcpp_lib=-lstdc++ d1_mini_lite.menu.exception.enabled=Enabled @@ -4340,10 +4280,7 @@ d1.menu.vt.heap=Heap d1.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM d1.menu.vt.iram=IRAM d1.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -d1.menu.exception.legacy=Legacy (new can return nullptr) -d1.menu.exception.legacy.build.exception_flags=-fno-exceptions -d1.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -d1.menu.exception.disabled=Disabled (new can abort) +d1.menu.exception.disabled=Disabled (new aborts on oom) d1.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT d1.menu.exception.disabled.build.stdcpp_lib=-lstdc++ d1.menu.exception.enabled=Enabled @@ -4530,10 +4467,7 @@ espino.menu.vt.heap=Heap espino.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM espino.menu.vt.iram=IRAM espino.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -espino.menu.exception.legacy=Legacy (new can return nullptr) -espino.menu.exception.legacy.build.exception_flags=-fno-exceptions -espino.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -espino.menu.exception.disabled=Disabled (new can abort) +espino.menu.exception.disabled=Disabled (new aborts on oom) espino.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT espino.menu.exception.disabled.build.stdcpp_lib=-lstdc++ espino.menu.exception.enabled=Enabled @@ -4723,10 +4657,7 @@ espinotee.menu.vt.heap=Heap espinotee.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM espinotee.menu.vt.iram=IRAM espinotee.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -espinotee.menu.exception.legacy=Legacy (new can return nullptr) -espinotee.menu.exception.legacy.build.exception_flags=-fno-exceptions -espinotee.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -espinotee.menu.exception.disabled=Disabled (new can abort) +espinotee.menu.exception.disabled=Disabled (new aborts on oom) espinotee.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT espinotee.menu.exception.disabled.build.stdcpp_lib=-lstdc++ espinotee.menu.exception.enabled=Enabled @@ -4930,10 +4861,7 @@ wifinfo.menu.vt.heap=Heap wifinfo.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM wifinfo.menu.vt.iram=IRAM wifinfo.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -wifinfo.menu.exception.legacy=Legacy (new can return nullptr) -wifinfo.menu.exception.legacy.build.exception_flags=-fno-exceptions -wifinfo.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -wifinfo.menu.exception.disabled=Disabled (new can abort) +wifinfo.menu.exception.disabled=Disabled (new aborts on oom) wifinfo.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT wifinfo.menu.exception.disabled.build.stdcpp_lib=-lstdc++ wifinfo.menu.exception.enabled=Enabled @@ -5179,10 +5107,7 @@ arduino-esp8266.menu.vt.heap=Heap arduino-esp8266.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM arduino-esp8266.menu.vt.iram=IRAM arduino-esp8266.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -arduino-esp8266.menu.exception.legacy=Legacy (new can return nullptr) -arduino-esp8266.menu.exception.legacy.build.exception_flags=-fno-exceptions -arduino-esp8266.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -arduino-esp8266.menu.exception.disabled=Disabled (new can abort) +arduino-esp8266.menu.exception.disabled=Disabled (new aborts on oom) arduino-esp8266.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT arduino-esp8266.menu.exception.disabled.build.stdcpp_lib=-lstdc++ arduino-esp8266.menu.exception.enabled=Enabled @@ -5370,10 +5295,7 @@ gen4iod.menu.vt.heap=Heap gen4iod.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM gen4iod.menu.vt.iram=IRAM gen4iod.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -gen4iod.menu.exception.legacy=Legacy (new can return nullptr) -gen4iod.menu.exception.legacy.build.exception_flags=-fno-exceptions -gen4iod.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -gen4iod.menu.exception.disabled=Disabled (new can abort) +gen4iod.menu.exception.disabled=Disabled (new aborts on oom) gen4iod.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT gen4iod.menu.exception.disabled.build.stdcpp_lib=-lstdc++ gen4iod.menu.exception.enabled=Enabled @@ -5628,10 +5550,7 @@ oak.menu.vt.heap=Heap oak.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM oak.menu.vt.iram=IRAM oak.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -oak.menu.exception.legacy=Legacy (new can return nullptr) -oak.menu.exception.legacy.build.exception_flags=-fno-exceptions -oak.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -oak.menu.exception.disabled=Disabled (new can abort) +oak.menu.exception.disabled=Disabled (new aborts on oom) oak.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT oak.menu.exception.disabled.build.stdcpp_lib=-lstdc++ oak.menu.exception.enabled=Enabled @@ -5818,10 +5737,7 @@ wifiduino.menu.vt.heap=Heap wifiduino.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM wifiduino.menu.vt.iram=IRAM wifiduino.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -wifiduino.menu.exception.legacy=Legacy (new can return nullptr) -wifiduino.menu.exception.legacy.build.exception_flags=-fno-exceptions -wifiduino.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -wifiduino.menu.exception.disabled=Disabled (new can abort) +wifiduino.menu.exception.disabled=Disabled (new aborts on oom) wifiduino.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT wifiduino.menu.exception.disabled.build.stdcpp_lib=-lstdc++ wifiduino.menu.exception.enabled=Enabled @@ -6008,10 +5924,7 @@ wifi_slot.menu.vt.heap=Heap wifi_slot.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM wifi_slot.menu.vt.iram=IRAM wifi_slot.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -wifi_slot.menu.exception.legacy=Legacy (new can return nullptr) -wifi_slot.menu.exception.legacy.build.exception_flags=-fno-exceptions -wifi_slot.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -wifi_slot.menu.exception.disabled=Disabled (new can abort) +wifi_slot.menu.exception.disabled=Disabled (new aborts on oom) wifi_slot.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT wifi_slot.menu.exception.disabled.build.stdcpp_lib=-lstdc++ wifi_slot.menu.exception.enabled=Enabled @@ -6312,10 +6225,7 @@ wiolink.menu.vt.heap=Heap wiolink.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM wiolink.menu.vt.iram=IRAM wiolink.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -wiolink.menu.exception.legacy=Legacy (new can return nullptr) -wiolink.menu.exception.legacy.build.exception_flags=-fno-exceptions -wiolink.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -wiolink.menu.exception.disabled=Disabled (new can abort) +wiolink.menu.exception.disabled=Disabled (new aborts on oom) wiolink.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT wiolink.menu.exception.disabled.build.stdcpp_lib=-lstdc++ wiolink.menu.exception.enabled=Enabled @@ -6502,10 +6412,7 @@ espectro.menu.vt.heap=Heap espectro.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM espectro.menu.vt.iram=IRAM espectro.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -espectro.menu.exception.legacy=Legacy (new can return nullptr) -espectro.menu.exception.legacy.build.exception_flags=-fno-exceptions -espectro.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -espectro.menu.exception.disabled=Disabled (new can abort) +espectro.menu.exception.disabled=Disabled (new aborts on oom) espectro.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT espectro.menu.exception.disabled.build.stdcpp_lib=-lstdc++ espectro.menu.exception.enabled=Enabled @@ -6692,10 +6599,7 @@ eduinowifi.menu.vt.heap=Heap eduinowifi.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM eduinowifi.menu.vt.iram=IRAM eduinowifi.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -eduinowifi.menu.exception.legacy=Legacy (new can return nullptr) -eduinowifi.menu.exception.legacy.build.exception_flags=-fno-exceptions -eduinowifi.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -eduinowifi.menu.exception.disabled=Disabled (new can abort) +eduinowifi.menu.exception.disabled=Disabled (new aborts on oom) eduinowifi.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT eduinowifi.menu.exception.disabled.build.stdcpp_lib=-lstdc++ eduinowifi.menu.exception.enabled=Enabled @@ -6892,10 +6796,7 @@ sonoff.menu.vt.heap=Heap sonoff.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM sonoff.menu.vt.iram=IRAM sonoff.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -sonoff.menu.exception.legacy=Legacy (new can return nullptr) -sonoff.menu.exception.legacy.build.exception_flags=-fno-exceptions -sonoff.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -sonoff.menu.exception.disabled=Disabled (new can abort) +sonoff.menu.exception.disabled=Disabled (new aborts on oom) sonoff.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT sonoff.menu.exception.disabled.build.stdcpp_lib=-lstdc++ sonoff.menu.exception.enabled=Enabled @@ -7123,10 +7024,7 @@ espmxdevkit.menu.vt.heap=Heap espmxdevkit.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM espmxdevkit.menu.vt.iram=IRAM espmxdevkit.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -espmxdevkit.menu.exception.legacy=Legacy (new can return nullptr) -espmxdevkit.menu.exception.legacy.build.exception_flags=-fno-exceptions -espmxdevkit.menu.exception.legacy.build.stdcpp_lib=-lstdc++ -espmxdevkit.menu.exception.disabled=Disabled (new can abort) +espmxdevkit.menu.exception.disabled=Disabled (new aborts on oom) espmxdevkit.menu.exception.disabled.build.exception_flags=-fno-exceptions -DNEW_OOM_ABORT espmxdevkit.menu.exception.disabled.build.stdcpp_lib=-lstdc++ espmxdevkit.menu.exception.enabled=Enabled diff --git a/cores/esp8266/FunctionalInterrupt.cpp b/cores/esp8266/FunctionalInterrupt.cpp index f35b315e9..665d8043b 100644 --- a/cores/esp8266/FunctionalInterrupt.cpp +++ b/cores/esp8266/FunctionalInterrupt.cpp @@ -7,7 +7,7 @@ typedef void (*voidFuncPtr)(void); typedef void (*voidFuncPtrArg)(void*); // Helper functions for Functional interrupt routines -extern "C" bool __attachInterruptFunctionalArg(uint8_t pin, voidFuncPtr userFunc, void*fp, int mode, bool functional); +extern "C" void __attachInterruptFunctionalArg(uint8_t pin, voidFuncPtr userFunc, void*fp, int mode, bool functional); void ICACHE_RAM_ATTR interruptFunctional(void* arg) @@ -34,52 +34,32 @@ extern "C" } } -bool attachInterrupt(uint8_t pin, std::function intRoutine, int mode) +void attachInterrupt(uint8_t pin, std::function intRoutine, int mode) { // use the local interrupt routine which takes the ArgStructure as argument InterruptInfo* ii = nullptr; - FunctionInfo* fi = new (std::nothrow) FunctionInfo; - if (fi == nullptr) - return false; + FunctionInfo* fi = new FunctionInfo; fi->reqFunction = intRoutine; - ArgStructure* as = new (std::nothrow) ArgStructure; - if (as == nullptr) - { - delete(fi); - return false; - } + ArgStructure* as = new ArgStructure; as->interruptInfo = ii; as->functionInfo = fi; - return __attachInterruptFunctionalArg(pin, (voidFuncPtr)interruptFunctional, as, mode, true); + __attachInterruptFunctionalArg(pin, (voidFuncPtr)interruptFunctional, as, mode, true); } -bool attachScheduledInterrupt(uint8_t pin, std::function scheduledIntRoutine, int mode) +void attachScheduledInterrupt(uint8_t pin, std::function scheduledIntRoutine, int mode) { - InterruptInfo* ii = new (std::nothrow) InterruptInfo; - if (ii == nullptr) - return false; + InterruptInfo* ii = new InterruptInfo; FunctionInfo* fi = new FunctionInfo; - if (fi == nullptr) - { - delete ii; - return false; - } fi->reqScheduledFunction = scheduledIntRoutine; - ArgStructure* as = new (std::nothrow) ArgStructure; - if (as == nullptr) - { - delete ii; - delete fi; - return false; - } + ArgStructure* as = new ArgStructure; as->interruptInfo = ii; as->functionInfo = fi; - return __attachInterruptFunctionalArg(pin, (voidFuncPtr)interruptFunctional, as, mode, true); + __attachInterruptFunctionalArg(pin, (voidFuncPtr)interruptFunctional, as, mode, true); } diff --git a/cores/esp8266/FunctionalInterrupt.h b/cores/esp8266/FunctionalInterrupt.h index 29f49542c..968793e49 100644 --- a/cores/esp8266/FunctionalInterrupt.h +++ b/cores/esp8266/FunctionalInterrupt.h @@ -28,8 +28,8 @@ struct ArgStructure { FunctionInfo* functionInfo = nullptr; }; -bool attachInterrupt(uint8_t pin, std::function intRoutine, int mode); -bool attachScheduledInterrupt(uint8_t pin, std::function scheduledIntRoutine, int mode); +void attachInterrupt(uint8_t pin, std::function intRoutine, int mode); +void attachScheduledInterrupt(uint8_t pin, std::function scheduledIntRoutine, int mode); #endif //INTERRUPTS_H diff --git a/cores/esp8266/Updater.cpp b/cores/esp8266/Updater.cpp index 3b9532021..e5224e381 100644 --- a/cores/esp8266/Updater.cpp +++ b/cores/esp8266/Updater.cpp @@ -182,7 +182,7 @@ bool UpdaterClass::begin(size_t size, int command, int ledPin, uint8_t ledOn) { } else { _bufferSize = 256; } - _buffer = new (std::nothrow) uint8_t[_bufferSize]; + _buffer = new uint8_t[_bufferSize]; _command = command; #ifdef DEBUG_UPDATER diff --git a/libraries/ArduinoOTA/ArduinoOTA.cpp b/libraries/ArduinoOTA/ArduinoOTA.cpp index 30f9c413e..64e8397a2 100644 --- a/libraries/ArduinoOTA/ArduinoOTA.cpp +++ b/libraries/ArduinoOTA/ArduinoOTA.cpp @@ -106,9 +106,9 @@ void ArduinoOTAClass::setRebootOnSuccess(bool reboot){ _rebootOnSuccess = reboot; } -bool ArduinoOTAClass::begin(bool useMDNS) { +void ArduinoOTAClass::begin(bool useMDNS) { if (_initialized) - return true; + return; _useMDNS = useMDNS; @@ -126,13 +126,11 @@ bool ArduinoOTAClass::begin(bool useMDNS) { _udp_ota = 0; } - _udp_ota = new (std::nothrow) UdpContext; - if (_udp_ota == nullptr) - return false; + _udp_ota = new UdpContext; _udp_ota->ref(); if(!_udp_ota->listen(IP_ADDR_ANY, _port)) - return false; + return; _udp_ota->onRx(std::bind(&ArduinoOTAClass::_onRx, this)); #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_MDNS) @@ -151,7 +149,6 @@ bool ArduinoOTAClass::begin(bool useMDNS) { #ifdef OTA_DEBUG OTA_DEBUG.printf("OTA server at: %s.local:%u\n", _hostname.c_str(), _port); #endif - return true; } int ArduinoOTAClass::parseInt(){ diff --git a/libraries/ArduinoOTA/ArduinoOTA.h b/libraries/ArduinoOTA/ArduinoOTA.h index 5a84fed23..1dfcaeed3 100644 --- a/libraries/ArduinoOTA/ArduinoOTA.h +++ b/libraries/ArduinoOTA/ArduinoOTA.h @@ -60,7 +60,7 @@ class ArduinoOTAClass void onProgress(THandlerFunction_Progress fn); //Starts the ArduinoOTA service - bool begin(bool useMDNS = true); + void begin(bool useMDNS = true); //Call this in loop() to run the service. Also calls MDNS.update() when begin() or begin(true) is used. void handle(); diff --git a/libraries/EEPROM/EEPROM.cpp b/libraries/EEPROM/EEPROM.cpp index c0cedb835..90bbf8ca5 100644 --- a/libraries/EEPROM/EEPROM.cpp +++ b/libraries/EEPROM/EEPROM.cpp @@ -64,12 +64,9 @@ void EEPROMClass::begin(size_t size) { //In case begin() is called a 2nd+ time, don't reallocate if size is the same if(_data && size != _size) { delete[] _data; - _data = new (std::nothrow) uint8_t[size]; + _data = new uint8_t[size]; } else if(!_data) { - _data = new (std::nothrow) uint8_t[size]; - } - if (_data == nullptr) { - return; + _data = new uint8_t[size]; } _size = size; diff --git a/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino b/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino index 7940ec7f8..2d6f49592 100644 --- a/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino +++ b/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino @@ -41,10 +41,7 @@ void loop() { // wait for WiFi connection if ((WiFiMulti.run() == WL_CONNECTED)) { - std::unique_ptrclient(new (std::nothrow) BearSSL::WiFiClientSecure); - if (client == nullptr) { - return; - } + std::unique_ptrclient(new BearSSL::WiFiClientSecure); client->setFingerprint(fingerprint); diff --git a/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino b/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino index 9d92b0c83..a69b9e35c 100644 --- a/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino +++ b/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino @@ -38,10 +38,7 @@ void loop() { // wait for WiFi connection if ((WiFiMulti.run() == WL_CONNECTED)) { - std::unique_ptr client(new (std::nothrow) BearSSL::WiFiClientSecure); - if (client == nullptr) { - return; - } + std::unique_ptr client(new BearSSL::WiFiClientSecure); bool mfln = client->probeMaxFragmentLength("tls.mbed.org", 443, 1024); Serial.printf("\nConnecting to https://tls.mbed.org\n"); diff --git a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp index 84770ee5c..580964da1 100644 --- a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp +++ b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp @@ -37,7 +37,7 @@ public: virtual std::unique_ptr create() { - return std::unique_ptr(new (std::nothrow) WiFiClient()); + return std::unique_ptr(new WiFiClient()); } virtual bool verify(WiFiClient& client, const char* host) @@ -59,9 +59,8 @@ public: std::unique_ptr create() override { - BearSSL::WiFiClientSecure *client = new (std::nothrow) BearSSL::WiFiClientSecure(); - if (client != nullptr) - client->setFingerprint(_fingerprint); + BearSSL::WiFiClientSecure *client = new BearSSL::WiFiClientSecure(); + client->setFingerprint(_fingerprint); return std::unique_ptr(client); } @@ -213,8 +212,8 @@ bool HTTPClient::begin(String url) if (!beginInternal(url, "http")) { return false; } - _transportTraits = TransportTraitsPtr(new (std::nothrow) TransportTraits()); - return _transportTraits != nullptr; + _transportTraits = TransportTraitsPtr(new TransportTraits()); + return true; } @@ -291,9 +290,9 @@ bool HTTPClient::begin(String host, uint16_t port, String uri) _host = host; _port = port; _uri = uri; - _transportTraits = TransportTraitsPtr(new (std::nothrow) TransportTraits()); + _transportTraits = TransportTraitsPtr(new TransportTraits()); DEBUG_HTTPCLIENT("[HTTP-Client][begin] host: %s port: %d uri: %s\n", host.c_str(), port, uri.c_str()); - return _transportTraits != nullptr; + return true; } @@ -310,13 +309,13 @@ bool HTTPClient::begin(String host, uint16_t port, String uri, const uint8_t htt _port = port; _uri = uri; - _transportTraits = TransportTraitsPtr(new (std::nothrow) BearSSLTraits(httpsFingerprint)); + _transportTraits = TransportTraitsPtr(new BearSSLTraits(httpsFingerprint)); DEBUG_HTTPCLIENT("[HTTP-Client][begin] host: %s port: %d url: %s BearSSL-httpsFingerprint:", host.c_str(), port, uri.c_str()); for (size_t i=0; i < 20; i++) { DEBUG_HTTPCLIENT(" %02x", httpsFingerprint[i]); } DEBUG_HTTPCLIENT("\n"); - return _transportTraits != nullptr; + return true; } diff --git a/libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino b/libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino index dd19e5623..a2514e171 100644 --- a/libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino +++ b/libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino @@ -106,7 +106,7 @@ void setup() MDNS.begin(host); - httpServer.getServer().setRSACert(new (std::nothrow) BearSSL::X509List(serverCert), new (std::nothrow) BearSSL::PrivateKey(serverKey)); + httpServer.getServer().setRSACert(new BearSSL::X509List(serverCert), new BearSSL::PrivateKey(serverKey)); httpUpdater.setup(&httpServer, update_path, update_username, update_password); httpServer.begin(); diff --git a/libraries/ESP8266LLMNR/ESP8266LLMNR.cpp b/libraries/ESP8266LLMNR/ESP8266LLMNR.cpp index f69367033..ac8582c57 100644 --- a/libraries/ESP8266LLMNR/ESP8266LLMNR.cpp +++ b/libraries/ESP8266LLMNR/ESP8266LLMNR.cpp @@ -116,9 +116,7 @@ bool LLMNRResponder::_restart() { if (igmp_joingroup(IP4_ADDR_ANY4, llmnr) != ERR_OK) return false; - _conn = new (std::nothrow) UdpContext; - if (!_conn) - return false; + _conn = new UdpContext; _conn->ref(); if (!_conn->listen(IP_ADDR_ANY, LLMNR_PORT)) diff --git a/libraries/ESP8266SSDP/ESP8266SSDP.cpp b/libraries/ESP8266SSDP/ESP8266SSDP.cpp index e0b5a5d64..93121ffc8 100644 --- a/libraries/ESP8266SSDP/ESP8266SSDP.cpp +++ b/libraries/ESP8266SSDP/ESP8266SSDP.cpp @@ -175,10 +175,7 @@ bool SSDPClass::begin() { assert(NULL == _server); - _server = new (std::nothrow) UdpContext; - if (_server == nullptr) { - return false; - } + _server = new UdpContext; _server->ref(); IPAddress local = WiFi.localIP(); @@ -511,9 +508,7 @@ void SSDPClass::_onTimerStatic(SSDPClass* self) { void SSDPClass::_startTimer() { _stopTimer(); - _timer = new (std::nothrow) SSDPTimer(); - if (_timer == nullptr) - return; + _timer = new SSDPTimer(); ETSTimer* tm = &(_timer->timer); const int interval = 1000; os_timer_disarm(tm); diff --git a/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino b/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino index c6c0d5563..4b786dc1a 100644 --- a/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino +++ b/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino @@ -128,7 +128,7 @@ void setup(void){ Serial.println("MDNS responder started"); } - server.getServer().setRSACert(new (std::nothrow) BearSSL::X509List(serverCert), new (std::nothrow) BearSSL::PrivateKey(serverKey)); + server.getServer().setRSACert(new BearSSL::X509List(serverCert), new BearSSL::PrivateKey(serverKey)); server.on("/", handleRoot); diff --git a/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino b/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino index 0671b122e..c2ceaca53 100644 --- a/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino +++ b/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino @@ -111,7 +111,7 @@ void setup() { ESP.restart(); } - server.getServer().setRSACert(new (std::nothrow) BearSSL::X509List(serverCert), new (std::nothrow) BearSSL::PrivateKey(serverKey)); + server.getServer().setRSACert(new BearSSL::X509List(serverCert), new BearSSL::PrivateKey(serverKey)); server.on("/",showcredentialpage); //for this simple example, just show a simple page for changing credentials at the root server.on("/" + change_creds,handlecredentialchange); //handles submission of credentials from the client server.onNotFound(redirect); diff --git a/libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h b/libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h index b85899610..a686c4346 100644 --- a/libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h +++ b/libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h @@ -266,7 +266,7 @@ void ESP8266WebServerTemplate::on(const Uri &uri, HTTPMethod method, template void ESP8266WebServerTemplate::on(const Uri &uri, HTTPMethod method, ESP8266WebServerTemplate::THandlerFunction fn, ESP8266WebServerTemplate::THandlerFunction ufn) { - _addRequestHandler(new (std::nothrow) FunctionRequestHandler(fn, ufn, uri, method)); + _addRequestHandler(new FunctionRequestHandler(fn, ufn, uri, method)); } template @@ -288,7 +288,7 @@ void ESP8266WebServerTemplate::_addRequestHandler(RequestHandlerType template void ESP8266WebServerTemplate::serveStatic(const char* uri, FS& fs, const char* path, const char* cache_header) { - _addRequestHandler(new (std::nothrow) StaticRequestHandler(fs, path, uri, cache_header)); + _addRequestHandler(new StaticRequestHandler(fs, path, uri, cache_header)); } template @@ -645,9 +645,7 @@ void ESP8266WebServerTemplate::collectHeaders(const char* headerKeys _headerKeysCount = headerKeysCount + 1; if (_currentHeaders) delete[]_currentHeaders; - _currentHeaders = new (std::nothrow) RequestArgument[_headerKeysCount]; - if (_currentHeaders == nullptr) - return; + _currentHeaders = new RequestArgument[_headerKeysCount]; _currentHeaders[0].key = FPSTR(AUTHORIZATION_HEADER); for (int i = 1; i < _headerKeysCount; i++){ _currentHeaders[i].key = headerKeys[i-1]; diff --git a/libraries/ESP8266WebServer/src/Parsing-impl.h b/libraries/ESP8266WebServer/src/Parsing-impl.h index 3eb170b44..4bb6db887 100644 --- a/libraries/ESP8266WebServer/src/Parsing-impl.h +++ b/libraries/ESP8266WebServer/src/Parsing-impl.h @@ -283,9 +283,7 @@ void ESP8266WebServerTemplate::_parseArguments(const String& data) { _currentArgCount = _parseArgumentsPrivate(data, nullArgHandler()); // allocate one more, this is needed because {"plain": plainBuf} is always added - _currentArgs = new (std::nothrow) RequestArgument[_currentArgCount + 1]; - if (_currentArgs == nullptr) - return; + _currentArgs = new RequestArgument[_currentArgCount + 1]; (void)_parseArgumentsPrivate(data, storeArgHandler()); } @@ -372,11 +370,7 @@ bool ESP8266WebServerTemplate::_parseForm(ClientType& client, const //start reading the form if (line == ("--"+boundary)){ if(_postArgs) delete[] _postArgs; - _postArgs = new (std::nothrow) RequestArgument[WEBSERVER_MAX_POST_ARGS]; - if (_postArgs == nullptr) { - DBGWS("Parse form: oom\n"); - return false; - } + _postArgs = new RequestArgument[WEBSERVER_MAX_POST_ARGS]; _postArgsLen = 0; while(1){ String argName; @@ -434,11 +428,7 @@ bool ESP8266WebServerTemplate::_parseForm(ClientType& client, const break; } } else { - _currentUpload.reset(new (std::nothrow) HTTPUpload()); - if (_currentUpload == nullptr) { - DBGWS("Parse form: oom\n"); - return false; - } + _currentUpload.reset(new HTTPUpload()); _currentUpload->status = UPLOAD_FILE_START; _currentUpload->name = argName; _currentUpload->filename = argFilename; @@ -531,9 +521,7 @@ readfile: arg.value = _currentArgs[iarg].value; } if (_currentArgs) delete[] _currentArgs; - _currentArgs = new (std::nothrow) RequestArgument[_postArgsLen]; - if (_currentArgs == nullptr) - return false; + _currentArgs = new RequestArgument[_postArgsLen]; for (iarg = 0; iarg < _postArgsLen; iarg++){ RequestArgument& arg = _currentArgs[iarg]; arg.key = _postArgs[iarg].key; diff --git a/libraries/ESP8266WebServer/src/Uri.h b/libraries/ESP8266WebServer/src/Uri.h index 6b0fa998b..95f5c8936 100644 --- a/libraries/ESP8266WebServer/src/Uri.h +++ b/libraries/ESP8266WebServer/src/Uri.h @@ -16,7 +16,7 @@ class Uri { virtual ~Uri() {} virtual Uri* clone() const { - return new (std::nothrow) Uri(_uri); + return new Uri(_uri); }; virtual bool canHandle(const String &requestUri, __attribute__((unused)) std::vector &pathArgs) { diff --git a/libraries/ESP8266WebServer/src/uri/UriBraces.h b/libraries/ESP8266WebServer/src/uri/UriBraces.h index fa32d6be9..29652efc7 100644 --- a/libraries/ESP8266WebServer/src/uri/UriBraces.h +++ b/libraries/ESP8266WebServer/src/uri/UriBraces.h @@ -10,7 +10,7 @@ class UriBraces : public Uri { explicit UriBraces(const String &uri) : Uri(uri) {}; Uri* clone() const override final { - return new (std::nothrow) UriBraces(_uri); + return new UriBraces(_uri); }; bool canHandle(const String &requestUri, std::vector &pathArgs) override final { diff --git a/libraries/ESP8266WebServer/src/uri/UriGlob.h b/libraries/ESP8266WebServer/src/uri/UriGlob.h index 8cab6e6bc..1e222cbab 100644 --- a/libraries/ESP8266WebServer/src/uri/UriGlob.h +++ b/libraries/ESP8266WebServer/src/uri/UriGlob.h @@ -11,7 +11,7 @@ class UriGlob : public Uri { explicit UriGlob(const String &uri) : Uri(uri) {}; Uri* clone() const override final { - return new (std::nothrow) UriGlob(_uri); + return new UriGlob(_uri); }; bool canHandle(const String &requestUri, __attribute__((unused)) std::vector &pathArgs) override final { diff --git a/libraries/ESP8266WebServer/src/uri/UriRegex.h b/libraries/ESP8266WebServer/src/uri/UriRegex.h index 47128eb3a..eef1b516d 100644 --- a/libraries/ESP8266WebServer/src/uri/UriRegex.h +++ b/libraries/ESP8266WebServer/src/uri/UriRegex.h @@ -25,7 +25,7 @@ class UriRegex : public Uri { } Uri* clone() const override final { - return new (std::nothrow) UriRegex(_uri); + return new UriRegex(_uri); }; bool canHandle(const String &requestUri, std::vector &pathArgs) override final { diff --git a/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino b/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino index fac012404..a599a0395 100644 --- a/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino +++ b/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino @@ -145,7 +145,7 @@ void setup() { return; // Can't connect to anything w/o certs! } - BearSSL::WiFiClientSecure *bear = new (std::nothrow) BearSSL::WiFiClientSecure(); + BearSSL::WiFiClientSecure *bear = new BearSSL::WiFiClientSecure(); // Integrate the cert store with this connection bear->setCertStore(&certStore); Serial.printf("Attempting to fetch https://github.com/...\n"); @@ -164,7 +164,7 @@ void loop() { site.replace(String("\n"), emptyString); Serial.printf("https://%s/\n", site.c_str()); - BearSSL::WiFiClientSecure *bear = new (std::nothrow) BearSSL::WiFiClientSecure(); + BearSSL::WiFiClientSecure *bear = new BearSSL::WiFiClientSecure(); // Integrate the cert store with this connection bear->setCertStore(&certStore); fetchURL(bear, site.c_str(), 443, "/"); diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino b/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino index 24249ffb5..d27382284 100644 --- a/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino +++ b/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino @@ -161,8 +161,8 @@ void setup() { Serial.println(WiFi.localIP()); // Attach the server private cert/key combo - BearSSL::X509List *serverCertList = new (std::nothrow) BearSSL::X509List(server_cert); - BearSSL::PrivateKey *serverPrivKey = new (std::nothrow) BearSSL::PrivateKey(server_private_key); + BearSSL::X509List *serverCertList = new BearSSL::X509List(server_cert); + BearSSL::PrivateKey *serverPrivKey = new BearSSL::PrivateKey(server_private_key); #ifndef USE_EC server.setRSACert(serverCertList, serverPrivKey); #else diff --git a/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino b/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino index 48dc6aba9..a50f11528 100644 --- a/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino +++ b/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino @@ -202,12 +202,12 @@ void setup() { setClock(); // Required for X.509 validation // Attach the server private cert/key combo - BearSSL::X509List *serverCertList = new (std::nothrow) BearSSL::X509List(server_cert); - BearSSL::PrivateKey *serverPrivKey = new (std::nothrow) BearSSL::PrivateKey(server_private_key); + BearSSL::X509List *serverCertList = new BearSSL::X509List(server_cert); + BearSSL::PrivateKey *serverPrivKey = new BearSSL::PrivateKey(server_private_key); server.setRSACert(serverCertList, serverPrivKey); // Require a certificate validated by the trusted CA - BearSSL::X509List *serverTrustedCA = new (std::nothrow) BearSSL::X509List(ca_cert); + BearSSL::X509List *serverTrustedCA = new BearSSL::X509List(ca_cert); server.setClientTrustAnchor(serverTrustedCA); // Actually start accepting connections diff --git a/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino b/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino index bf547665e..9102af12d 100644 --- a/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino +++ b/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino @@ -85,7 +85,7 @@ void setup() { Serial.swap(); // Hardware serial is now on RX:GPIO13 TX:GPIO15 // use SoftwareSerial on regular RX(3)/TX(1) for logging - logger = new (std::nothrow) SoftwareSerial(3, 1); + logger = new SoftwareSerial(3, 1); logger->begin(BAUD_LOGGER); logger->enableIntTx(false); logger->println("\n\nUsing SoftwareSerial for logging"); diff --git a/libraries/ESP8266WiFi/src/BearSSLHelpers.cpp b/libraries/ESP8266WiFi/src/BearSSLHelpers.cpp index 6ffcca08d..b3d1b60c2 100644 --- a/libraries/ESP8266WiFi/src/BearSSLHelpers.cpp +++ b/libraries/ESP8266WiFi/src/BearSSLHelpers.cpp @@ -109,7 +109,7 @@ namespace brssl { } static bool certificate_to_trust_anchor_inner(br_x509_trust_anchor *ta, const br_x509_certificate *xc) { - std::unique_ptr dc(new (std::nothrow) br_x509_decoder_context); // auto-delete on exit + std::unique_ptr dc(new br_x509_decoder_context); // auto-delete on exit std::vector vdn; br_x509_pkey *pk; @@ -244,7 +244,7 @@ namespace brssl { // blobs may be returned. pem_object *decode_pem(const void *src, size_t len, size_t *num) { std::vector pem_list; - std::unique_ptr pc(new (std::nothrow) br_pem_decoder_context); // auto-delete on exit + std::unique_ptr pc(new br_pem_decoder_context); // auto-delete on exit if (!pc.get()) { return nullptr; } @@ -405,7 +405,7 @@ namespace brssl { } static public_key *decode_public_key(const unsigned char *buff, size_t len) { - std::unique_ptr dc(new (std::nothrow) br_pkey_decoder_context); // auto-delete on exit + std::unique_ptr dc(new br_pkey_decoder_context); // auto-delete on exit if (!dc.get()) { return nullptr; } @@ -477,7 +477,7 @@ namespace brssl { } static private_key *decode_private_key(const unsigned char *buff, size_t len) { - std::unique_ptr dc(new (std::nothrow) br_skey_decoder_context); // auto-delete on exit + std::unique_ptr dc(new br_skey_decoder_context); // auto-delete on exit if (!dc.get()) { return nullptr; } diff --git a/libraries/ESP8266WiFi/src/ESP8266WiFiScan.cpp b/libraries/ESP8266WiFi/src/ESP8266WiFiScan.cpp index 0eb588983..65878a3d5 100644 --- a/libraries/ESP8266WiFi/src/ESP8266WiFiScan.cpp +++ b/libraries/ESP8266WiFi/src/ESP8266WiFiScan.cpp @@ -308,10 +308,7 @@ void ESP8266WiFiScanClass::_scanDone(void* result, int status) { if(i == 0) { ESP8266WiFiScanClass::_scanResult = 0; } else { - bss_info* copied_info = new (std::nothrow) bss_info[i]; - if (copied_info == nullptr) { - return; - } + bss_info* copied_info = new bss_info[i]; i = 0; for(bss_info* it = head; it; it = STAILQ_NEXT(it, next), ++i) { memcpy(copied_info + i, it, sizeof(bss_info)); diff --git a/libraries/ESP8266WiFi/src/WiFiClient.cpp b/libraries/ESP8266WiFi/src/WiFiClient.cpp index 136016b07..1663a29ec 100644 --- a/libraries/ESP8266WiFi/src/WiFiClient.cpp +++ b/libraries/ESP8266WiFi/src/WiFiClient.cpp @@ -153,10 +153,7 @@ int WiFiClient::connect(IPAddress ip, uint16_t port) pcb->local_port = _localPort++; } - _client = new (std::nothrow) ClientContext(pcb, nullptr, nullptr); - if (_client == nullptr) { - return 0; - } + _client = new ClientContext(pcb, nullptr, nullptr); _client->ref(); _client->setTimeout(_timeout); int res = _client->connect(ip, port); diff --git a/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp b/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp index 281612f7e..2aa177b64 100644 --- a/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp +++ b/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp @@ -1580,21 +1580,21 @@ bool WiFiClientSecure::probeMaxFragmentLength(IPAddress ip, uint16_t port, uint1 // AXTLS compatibility interfaces bool WiFiClientSecure::setCACert(const uint8_t* pk, size_t size) { _axtls_ta = nullptr; - _axtls_ta = std::shared_ptr(new (std::nothrow) X509List(pk, size)); + _axtls_ta = std::shared_ptr(new X509List(pk, size)); _ta = _axtls_ta.get(); return _ta ? true : false; } bool WiFiClientSecure::setCertificate(const uint8_t* pk, size_t size) { _axtls_chain = nullptr; - _axtls_chain = std::shared_ptr(new (std::nothrow) X509List(pk, size)); + _axtls_chain = std::shared_ptr(new X509List(pk, size)); _chain = _axtls_chain.get(); return _chain ? true : false; } bool WiFiClientSecure::setPrivateKey(const uint8_t* pk, size_t size) { _axtls_sk = nullptr; - _axtls_sk = std::shared_ptr(new (std::nothrow) PrivateKey(pk, size)); + _axtls_sk = std::shared_ptr(new PrivateKey(pk, size)); _sk = _axtls_sk.get(); return _sk ? true : false; diff --git a/libraries/ESP8266WiFi/src/WiFiServer.cpp b/libraries/ESP8266WiFi/src/WiFiServer.cpp index 1ec78fed7..2ee09f85f 100644 --- a/libraries/ESP8266WiFi/src/WiFiServer.cpp +++ b/libraries/ESP8266WiFi/src/WiFiServer.cpp @@ -186,10 +186,7 @@ long WiFiServer::_accept(tcp_pcb* apcb, long err) { // always accept new PCB so incoming data can be stored in our buffers even before // user calls ::available() - ClientContext* client = new (std::nothrow) ClientContext(apcb, &WiFiServer::_s_discard, this); - if (client == nullptr) { - return ERR_MEM; - } + ClientContext* client = new ClientContext(apcb, &WiFiServer::_s_discard, this); // backlog doc: // http://lwip.100.n7.nabble.com/Problem-re-opening-listening-pbc-tt32484.html#a32494 diff --git a/libraries/ESP8266WiFi/src/WiFiServerSecureBearSSL.cpp b/libraries/ESP8266WiFi/src/WiFiServerSecureBearSSL.cpp index b4cb0e0e9..087c90b4e 100644 --- a/libraries/ESP8266WiFi/src/WiFiServerSecureBearSSL.cpp +++ b/libraries/ESP8266WiFi/src/WiFiServerSecureBearSSL.cpp @@ -107,8 +107,8 @@ WiFiClientSecure WiFiServerSecure::available(uint8_t* status) { void WiFiServerSecure::setServerKeyAndCert(const uint8_t *key, int keyLen, const uint8_t *cert, int certLen) { _axtls_chain = nullptr; _axtls_sk = nullptr; - _axtls_chain = std::shared_ptr(new (std::nothrow) X509List(cert, certLen)); - _axtls_sk = std::shared_ptr(new (std::nothrow) PrivateKey(key, keyLen)); + _axtls_chain = std::shared_ptr(new X509List(cert, certLen)); + _axtls_sk = std::shared_ptr(new PrivateKey(key, keyLen)); setRSACert(_axtls_chain.get(), _axtls_sk.get()); } diff --git a/libraries/ESP8266WiFi/src/WiFiUdp.cpp b/libraries/ESP8266WiFi/src/WiFiUdp.cpp index 8bbcddb27..a0a5c1d4e 100644 --- a/libraries/ESP8266WiFi/src/WiFiUdp.cpp +++ b/libraries/ESP8266WiFi/src/WiFiUdp.cpp @@ -80,10 +80,7 @@ uint8_t WiFiUDP::begin(uint16_t port) _ctx = 0; } - _ctx = new (std::nothrow) UdpContext; - if (_ctx == nullptr) { - return 0; - } + _ctx = new UdpContext; _ctx->ref(); return (_ctx->listen(IPAddress(), port)) ? 1 : 0; } @@ -99,10 +96,7 @@ uint8_t WiFiUDP::beginMulticast(IPAddress interfaceAddr, IPAddress multicast, ui return 0; } - _ctx = new (std::nothrow) UdpContext; - if (_ctx == nullptr) { - return 0; - } + _ctx = new UdpContext; _ctx->ref(); ip_addr_t addr = IPADDR4_INIT(INADDR_ANY); if (!_ctx->listen(&addr, port)) { @@ -153,10 +147,7 @@ int WiFiUDP::beginPacket(const char *host, uint16_t port) int WiFiUDP::beginPacket(IPAddress ip, uint16_t port) { if (!_ctx) { - _ctx = new (std::nothrow) UdpContext; - if (_ctx == nullptr) { - return 0; - } + _ctx = new UdpContext; _ctx->ref(); } return (_ctx->connect(ip, port)) ? 1 : 0; @@ -166,10 +157,7 @@ int WiFiUDP::beginPacketMulticast(IPAddress multicastAddress, uint16_t port, IPAddress interfaceAddress, int ttl) { if (!_ctx) { - _ctx = new (std::nothrow) UdpContext; - if (_ctx == nullptr) { - return 0; - } + _ctx = new UdpContext; _ctx->ref(); } if (!_ctx->connect(multicastAddress, port)) { diff --git a/libraries/ESP8266WiFi/src/include/ClientContext.h b/libraries/ESP8266WiFi/src/include/ClientContext.h index 47407bc00..8095e402a 100644 --- a/libraries/ESP8266WiFi/src/include/ClientContext.h +++ b/libraries/ESP8266WiFi/src/include/ClientContext.h @@ -374,7 +374,7 @@ public: if (!_pcb) { return 0; } - return _write_from_source(new (std::nothrow) BufferDataSource(data, size)); + return _write_from_source(new BufferDataSource(data, size)); } size_t write(Stream& stream) @@ -382,7 +382,7 @@ public: if (!_pcb) { return 0; } - return _write_from_source(new (std::nothrow) BufferedStreamDataSource(stream, stream.available())); + return _write_from_source(new BufferedStreamDataSource(stream, stream.available())); } size_t write_P(PGM_P buf, size_t size) @@ -391,7 +391,7 @@ public: return 0; } ProgmemStream stream(buf, size); - return _write_from_source(new (std::nothrow) BufferedStreamDataSource(stream, size)); + return _write_from_source(new BufferedStreamDataSource(stream, size)); } void keepAlive (uint16_t idle_sec = TCP_DEFAULT_KEEPALIVE_IDLE_SEC, uint16_t intv_sec = TCP_DEFAULT_KEEPALIVE_INTERVAL_SEC, uint8_t count = TCP_DEFAULT_KEEPALIVE_COUNT) diff --git a/libraries/ESP8266WiFi/src/include/DataSource.h b/libraries/ESP8266WiFi/src/include/DataSource.h index 624a9277e..2a0bfed26 100644 --- a/libraries/ESP8266WiFi/src/include/DataSource.h +++ b/libraries/ESP8266WiFi/src/include/DataSource.h @@ -75,7 +75,7 @@ public: //Buffer too small? if (_bufferSize < min_buffer_size) { - uint8_t *new_buffer = new (std::nothrow) uint8_t[min_buffer_size]; + uint8_t *new_buffer = new uint8_t[min_buffer_size]; //If stream reading is ahead, than some data is already in the old buffer and needs to be copied to new resized buffer if (_buffer && stream_read > 0) { memcpy(new_buffer, _buffer.get(), stream_read); diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino b/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino index 26fd06fbd..e196ef641 100644 --- a/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino +++ b/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino @@ -74,9 +74,9 @@ void setup() { WiFiMulti.addAP(STASSID, STAPSK); #if MANUAL_SIGNING - signPubKey = new (std::nothrow) BearSSL::PublicKey(pubkey); - hash = new (std::nothrow) BearSSL::HashSHA256(); - sign = new (std::nothrow) BearSSL::SigningVerifier(signPubKey); + signPubKey = new BearSSL::PublicKey(pubkey); + hash = new BearSSL::HashSHA256(); + sign = new BearSSL::SigningVerifier(signPubKey); #endif } diff --git a/libraries/ESP8266mDNS/src/ESP8266mDNS_Legacy.cpp b/libraries/ESP8266mDNS/src/ESP8266mDNS_Legacy.cpp index c15ead17b..879119552 100644 --- a/libraries/ESP8266mDNS/src/ESP8266mDNS_Legacy.cpp +++ b/libraries/ESP8266mDNS/src/ESP8266mDNS_Legacy.cpp @@ -225,11 +225,7 @@ bool MDNSResponder::_listen() return false; } - _conn = new (std::nothrow) UdpContext; - if (_conn == nullptr) - { - return false; - } + _conn = new UdpContext; _conn->ref(); if (!_conn->listen(IP_ADDR_ANY, MDNS_PORT)) @@ -280,11 +276,7 @@ bool MDNSResponder::addServiceTxt(char *name, char *proto, char *key, char *valu { return false; //max txt record size } - MDNSTxt *newtxt = new (std::nothrow) MDNSTxt; - if (newtxt == nullptr) - { - return false; - } + MDNSTxt *newtxt = new MDNSTxt; newtxt->_txt = String(key) + '=' + String(value); newtxt->_next = 0; if (servicePtr->_txts == 0) //no services have been added diff --git a/libraries/LittleFS/src/LittleFS.cpp b/libraries/LittleFS/src/LittleFS.cpp index 6de443fff..7fd4351fc 100644 --- a/libraries/LittleFS/src/LittleFS.cpp +++ b/libraries/LittleFS/src/LittleFS.cpp @@ -203,7 +203,7 @@ int LittleFSImpl::lfs_flash_sync(const struct lfs_config *c) { #endif #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_LITTLEFS) -FS LittleFS = FS(FSImplPtr(new (std::nothrow) littlefs_impl::LittleFSImpl(FS_PHYS_ADDR, FS_PHYS_SIZE, FS_PHYS_PAGE, FS_PHYS_BLOCK, FS_MAX_OPEN_FILES))); +FS LittleFS = FS(FSImplPtr(new littlefs_impl::LittleFSImpl(FS_PHYS_ADDR, FS_PHYS_SIZE, FS_PHYS_PAGE, FS_PHYS_BLOCK, FS_MAX_OPEN_FILES))); extern "C" void littlefs_request_end(void) { diff --git a/libraries/LittleFS/src/LittleFS.h b/libraries/LittleFS/src/LittleFS.h index 7af4c0e2b..f78680f66 100644 --- a/libraries/LittleFS/src/LittleFS.h +++ b/libraries/LittleFS/src/LittleFS.h @@ -324,11 +324,7 @@ class LittleFSFileImpl : public FileImpl { public: LittleFSFileImpl(LittleFSImpl* fs, const char *name, std::shared_ptr fd, int flags, time_t creation) : _fs(fs), _fd(fd), _opened(true), _flags(flags), _creation(creation) { - _name = std::shared_ptr(new (std::nothrow) char[strlen(name) + 1], std::default_delete()); - if (!_name) { - close(); - return; - } + _name = std::shared_ptr(new char[strlen(name) + 1], std::default_delete()); strcpy(_name.get(), name); } @@ -521,26 +517,17 @@ public: { memset(&_dirent, 0, sizeof(_dirent)); if (dirPath) { - _dirPath = std::shared_ptr(new (std::nothrow) char[strlen(dirPath) + 1], std::default_delete()); - if (_dirPath == nullptr) { - close(); - return; - } + _dirPath = std::shared_ptr(new char[strlen(dirPath) + 1], std::default_delete()); strcpy(_dirPath.get(), dirPath); } } - void close () { + ~LittleFSDirImpl() override { if (_opened) { lfs_dir_close(_fs->getFS(), _getDir()); - _opened = false; } } - ~LittleFSDirImpl() override { - close(); - } - FileImplPtr openFile(OpenMode openMode, AccessMode accessMode) override { if (!_valid) { return FileImplPtr(); diff --git a/libraries/SDFS/src/SDFS.cpp b/libraries/SDFS/src/SDFS.cpp index 90ef270dc..d862ff5d8 100644 --- a/libraries/SDFS/src/SDFS.cpp +++ b/libraries/SDFS/src/SDFS.cpp @@ -32,7 +32,7 @@ using namespace fs; #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SDFS) -FS SDFS = FS(FSImplPtr(new (std::nothrow) sdfs::SDFSImpl())); +FS SDFS = FS(FSImplPtr(new sdfs::SDFSImpl())); #endif namespace sdfs { diff --git a/libraries/esp8266/examples/ConfigFile/ConfigFile.ino b/libraries/esp8266/examples/ConfigFile/ConfigFile.ino index d03c19790..cb1d25be0 100644 --- a/libraries/esp8266/examples/ConfigFile/ConfigFile.ino +++ b/libraries/esp8266/examples/ConfigFile/ConfigFile.ino @@ -25,10 +25,7 @@ bool loadConfig() { } // Allocate a buffer to store contents of the file. - std::unique_ptr buf(new (std::nothrow) char[size]); - if (buf == nullptr) { - return false; - } + std::unique_ptr buf(new char[size]); // We don't use String here because ArduinoJson library requires the input // buffer to be mutable. If you don't use ArduinoJson, you may as well diff --git a/libraries/esp8266/examples/SerialStress/SerialStress.ino b/libraries/esp8266/examples/SerialStress/SerialStress.ino index b93e44360..1412abd2b 100644 --- a/libraries/esp8266/examples/SerialStress/SerialStress.ino +++ b/libraries/esp8266/examples/SerialStress/SerialStress.ino @@ -72,7 +72,7 @@ void setup() { // using HardwareSerial0 pins, // so we can still log to the regular usbserial chips - SoftwareSerial* ss = new (std::nothrow) SoftwareSerial(3, 1); + SoftwareSerial* ss = new SoftwareSerial(3, 1); ss->begin(SSBAUD); ss->enableIntTx(false); logger = ss; diff --git a/tools/boards.txt.py b/tools/boards.txt.py index 7be8f695d..95d6dc43f 100755 --- a/tools/boards.txt.py +++ b/tools/boards.txt.py @@ -994,10 +994,10 @@ macros = { ]), 'exception_menu': collections.OrderedDict([ - ( '.menu.exception.legacy', 'Legacy (new can return nullptr)' ), - ( '.menu.exception.legacy.build.exception_flags', '-fno-exceptions' ), - ( '.menu.exception.legacy.build.stdcpp_lib', '-lstdc++' ), - ( '.menu.exception.disabled', 'Disabled (new can abort)' ), + #( '.menu.exception.legacy', 'Legacy (new returns nullptr on oom, constructor issue)' ), + #( '.menu.exception.legacy.build.exception_flags', '-fno-exceptions' ), + #( '.menu.exception.legacy.build.stdcpp_lib', '-lstdc++' ), + ( '.menu.exception.disabled', 'Disabled (new aborts on oom)' ), ( '.menu.exception.disabled.build.exception_flags', '-fno-exceptions -DNEW_OOM_ABORT' ), ( '.menu.exception.disabled.build.stdcpp_lib', '-lstdc++' ), ( '.menu.exception.enabled', 'Enabled' ),