diff --git a/hardware/arduino/cores/arduino/new.cpp b/hardware/arduino/cores/arduino/new.cpp index 0f6d4220e..b81031e90 100644 --- a/hardware/arduino/cores/arduino/new.cpp +++ b/hardware/arduino/cores/arduino/new.cpp @@ -5,10 +5,20 @@ void * operator new(size_t size) return malloc(size); } +void * operator new[](size_t size) +{ + return malloc(size); +} + void operator delete(void * ptr) { free(ptr); -} +} + +void operator delete[](void * ptr) +{ + free(ptr); +} int __cxa_guard_acquire(__guard *g) {return !*(char *)(g);}; void __cxa_guard_release (__guard *g) {*(char *)g = 1;}; diff --git a/hardware/arduino/cores/arduino/new.h b/hardware/arduino/cores/arduino/new.h index cd940ce8b..991c86c75 100644 --- a/hardware/arduino/cores/arduino/new.h +++ b/hardware/arduino/cores/arduino/new.h @@ -8,7 +8,9 @@ #include void * operator new(size_t size); -void operator delete(void * ptr); +void * operator new[](size_t size); +void operator delete(void * ptr); +void operator delete[](void * ptr); __extension__ typedef int __guard __attribute__((mode (__DI__)));