diff --git a/libraries/AP_Common/c++.cpp b/libraries/AP_Common/c++.cpp index 98df0805e5..b104b8a70c 100644 --- a/libraries/AP_Common/c++.cpp +++ b/libraries/AP_Common/c++.cpp @@ -11,19 +11,8 @@ #include #include "c++.h" -#ifndef EXCLUDECORE -#if defined(ARDUINO) && ARDUINO >= 100 - #include "Arduino.h" -#else - #include "WProgram.h" -#endif -#endif - void * operator new(size_t size) { -#ifdef AP_DISPLAYMEM - displayMemory(); -#endif return(calloc(size, 1)); } @@ -32,22 +21,12 @@ void operator delete(void *p) if (p) free(p); } -extern "C" void __cxa_pure_virtual() -{ - while (1) - { -#ifndef EXCLUDECORE - Serial.println("Error: pure virtual call"); - delay(1000); -#endif - } +extern "C" void __cxa_pure_virtual(){ + while (1){} } void * operator new[](size_t size) { -#ifdef AP_DISPLAYMEM - displayMemory(); -#endif return(calloc(size, 1)); } @@ -63,38 +42,10 @@ int __cxa_guard_acquire(__guard *g) return !*(char *)(g); }; -void __cxa_guard_release (__guard *g) -{ +void __cxa_guard_release (__guard *g){ *(char *)g = 1; }; void __cxa_guard_abort (__guard *) { }; -// free memory -extern unsigned int __bss_end; -extern void *__brkval; - -void displayMemory() -{ - static int minMemFree=0; - if (minMemFree<=0 || freeMemory()