Skip to content

Commit 017b8f0

Browse files
committed
Platform: Replace non throwing versions of new operator.
This change prevents inclusion of non throwing versions of the new operator from the compiler standard library. On GCC, the non throwing version bring with it some portion of the exception support code.
1 parent 4de4481 commit 017b8f0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

platform/mbed_retarget.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,16 @@ void *operator new[](std::size_t count)
10081008
return buffer;
10091009
}
10101010

1011+
void *operator new(std::size_t count, const std::nothrow_t& tag)
1012+
{
1013+
return malloc(count);
1014+
}
1015+
1016+
void *operator new[](std::size_t count, const std::nothrow_t& tag)
1017+
{
1018+
return malloc(count);
1019+
}
1020+
10111021
void operator delete(void *ptr)
10121022
{
10131023
if (ptr != NULL) {

0 commit comments

Comments
 (0)