mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-07 16:38:30 -04:00
d2a2ee0fd8
git-svn-id: https://arducopter.googlecode.com/svn/trunk@855 f9c3cf11-9bcb-44bc-f272-b75c42450872
36 lines
592 B
C++
36 lines
592 B
C++
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-
|
|
|
|
//
|
|
// C++ runtime support not provided by Arduino
|
|
//
|
|
// Note: use new/delete with caution. The heap is small and
|
|
// easily fragmented.
|
|
//
|
|
|
|
#include <stdlib.h>
|
|
|
|
void * operator new(size_t size)
|
|
{
|
|
return(calloc(size, 1));
|
|
}
|
|
|
|
void operator delete(void *p)
|
|
{
|
|
if (p)
|
|
free(p);
|
|
}
|
|
|
|
__extension__ typedef int __guard __attribute__((mode (__DI__)));
|
|
|
|
int __cxa_guard_acquire(__guard *g)
|
|
{
|
|
return !*(char *)(g);
|
|
};
|
|
|
|
void __cxa_guard_release (__guard *g)
|
|
{
|
|
*(char *)g = 1;
|
|
};
|
|
|
|
void __cxa_guard_abort (__guard *) {};
|