aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/new.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cores/arduino/new.cpp')
-rw-r--r--cores/arduino/new.cpp38
1 files changed, 23 insertions, 15 deletions
diff --git a/cores/arduino/new.cpp b/cores/arduino/new.cpp
index b81031e..cf6f89c 100644
--- a/cores/arduino/new.cpp
+++ b/cores/arduino/new.cpp
@@ -1,28 +1,36 @@
-#include <new.h>
+/*
+ Copyright (c) 2014 Arduino. All right reserved.
-void * operator new(size_t size)
-{
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include <stdlib.h>
+
+void *operator new(size_t size) {
return malloc(size);
}
-void * operator new[](size_t size)
-{
+void *operator new[](size_t size) {
return malloc(size);
}
-void operator delete(void * ptr)
-{
+void operator delete(void * ptr) {
free(ptr);
}
-void operator delete[](void * 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;};
-void __cxa_guard_abort (__guard *) {};
-
-void __cxa_pure_virtual(void) {};
-