Skip to content

Commit 73da7ee

Browse files
committed
extended new/delete operators now defined by Arduino
1 parent c126aca commit 73da7ee

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

del_opv.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <cstdlib>
2222
#include <func_exception>
2323

24-
_UCXXEXPORT void operator delete[](void * ptr) throw(){
25-
free(ptr);
26-
}
24+
// Arduino now defines this.
25+
//_UCXXEXPORT void operator delete[](void * ptr) throw(){
26+
// free(ptr);
27+
//}

new_opv.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
#include <cstdlib>
2222
#include <func_exception>
2323

24+
25+
// Arduino now defines this
26+
#if 0
2427
_UCXXEXPORT void* operator new[](std::size_t numBytes) throw(std::bad_alloc){
2528
//C++ stardard 5.3.4.8 requires that a valid pointer be returned for
2629
//a call to new(0). Thus:
@@ -33,3 +36,4 @@ _UCXXEXPORT void* operator new[](std::size_t numBytes) throw(std::bad_alloc){
3336
}
3437
return p;
3538
}
39+
#endif

0 commit comments

Comments
 (0)