From 09b755fb9c3f5c42fa9b38ffeef0dbfa2cfd8315 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Sun, 16 Dec 2012 14:30:12 +0100 Subject: Add trivial new[] and delete[] operators (Justin R. Cutler) Fixes #73 Fixes #883 --- cores/arduino/new.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'cores/arduino/new.cpp') diff --git a/cores/arduino/new.cpp b/cores/arduino/new.cpp index 0f6d422..b81031e 100644 --- a/cores/arduino/new.cpp +++ b/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;}; -- cgit v1.2.3-18-g5258