|
1 |
| -#include <new.h> |
| 1 | +/* |
| 2 | + Copyright (c) 2014 Arduino. All right reserved. |
2 | 3 |
|
3 |
| -void * operator new(size_t size) |
4 |
| -{ |
| 4 | + This library is free software; you can redistribute it and/or |
| 5 | + modify it under the terms of the GNU Lesser General Public |
| 6 | + License as published by the Free Software Foundation; either |
| 7 | + version 2.1 of the License, or (at your option) any later version. |
| 8 | +
|
| 9 | + This library is distributed in the hope that it will be useful, |
| 10 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 12 | + See the GNU Lesser General Public License for more details. |
| 13 | +
|
| 14 | + You should have received a copy of the GNU Lesser General Public |
| 15 | + License along with this library; if not, write to the Free Software |
| 16 | + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 17 | +*/ |
| 18 | + |
| 19 | +#include <stdlib.h> |
| 20 | + |
| 21 | +void *operator new(size_t size) { |
5 | 22 | return malloc(size);
|
6 | 23 | }
|
7 | 24 |
|
8 |
| -void * operator new[](size_t size) |
9 |
| -{ |
| 25 | +void *operator new[](size_t size) { |
10 | 26 | return malloc(size);
|
11 | 27 | }
|
12 | 28 |
|
13 |
| -void operator delete(void * ptr) |
14 |
| -{ |
| 29 | +void operator delete(void * ptr) { |
15 | 30 | free(ptr);
|
16 | 31 | }
|
17 | 32 |
|
18 |
| -void operator delete[](void * ptr) |
19 |
| -{ |
| 33 | +void operator delete[](void * ptr) { |
20 | 34 | free(ptr);
|
21 | 35 | }
|
22 | 36 |
|
23 |
| -int __cxa_guard_acquire(__guard *g) {return !*(char *)(g);}; |
24 |
| -void __cxa_guard_release (__guard *g) {*(char *)g = 1;}; |
25 |
| -void __cxa_guard_abort (__guard *) {}; |
26 |
| - |
27 |
| -void __cxa_pure_virtual(void) {}; |
28 |
| - |
|
0 commit comments