1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-02 14:22:55 +03:00

replace new by new (std::nothrow), remove arduino_new

This commit is contained in:
david gauchard
2020-08-17 18:15:45 +02:00
parent 5b3d290de8
commit 6925982284
45 changed files with 207 additions and 167 deletions

View File

@ -25,7 +25,10 @@ bool loadConfig() {
}
// Allocate a buffer to store contents of the file.
std::unique_ptr<char[]> buf(new char[size]);
std::unique_ptr<char[]> buf(new (std::nothrow) char[size]);
if (buf == nullptr) {
return false;
}
// 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

View File

@ -72,7 +72,7 @@ void setup() {
// using HardwareSerial0 pins,
// so we can still log to the regular usbserial chips
SoftwareSerial* ss = new SoftwareSerial(3, 1);
SoftwareSerial* ss = new (std::nothrow) SoftwareSerial(3, 1);
ss->begin(SSBAUD);
ss->enableIntTx(false);
logger = ss;