Skip to content

Commit 6a46b9c

Browse files
authored
Merge pull request #5165 from pan-/non-throwing-new-operator
Platform: Replace non throwing versions of new operator.
2 parents 3759d03 + 017b8f0 commit 6a46b9c

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)