mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-01 12:24:14 +01:00
Add trivial new[] and delete[] operators (Justin R. Cutler)
Fixes #73 Fixes #883
This commit is contained in:
parent
27e6e8c80c
commit
141684d410
@ -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;};
|
||||
|
@ -8,7 +8,9 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
void * operator new(size_t size);
|
||||
void operator delete(void * ptr);
|
||||
void * operator new[](size_t size);
|
||||
void operator delete(void * ptr);
|
||||
void operator delete[](void * ptr);
|
||||
|
||||
__extension__ typedef int __guard __attribute__((mode (__DI__)));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user