mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-19 14:23:57 -04:00
Add support for 'new' and 'delete', so we can cons things on the fly.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@668 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
parent
24202b7c46
commit
23ccff2ccd
21
libraries/AP_Common/c++.cpp
Normal file
21
libraries/AP_Common/c++.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
// -*- 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);
|
||||
}
|
4
libraries/AP_Common/keywords.txt
Normal file
4
libraries/AP_Common/keywords.txt
Normal file
@ -0,0 +1,4 @@
|
||||
Menu KEYWORD1
|
||||
run KEYWORD2
|
||||
Location KEYWORD2
|
||||
|
Loading…
Reference in New Issue
Block a user