Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6a71747

Browse files
authored
Add noexcept specifier to placement new operator
The standard mandates that placement new should be have a noexcept specifier.
1 parent b410611 commit 6a71747

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cores/arduino/new.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void *operator new[](size_t size) {
2626
return malloc(size);
2727
}
2828

29-
void * operator new(size_t size, void * ptr) {
29+
void * operator new(size_t size, void * ptr) noexcept {
3030
(void)size;
3131
return ptr;
3232
}

cores/arduino/new.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
void * operator new(size_t size);
2525
void * operator new[](size_t size);
26-
void * operator new(size_t size, void * ptr);
26+
void * operator new(size_t size, void * ptr) noexcept;
2727
void operator delete(void * ptr);
2828
void operator delete[](void * ptr);
2929

0 commit comments

Comments
 (0)