diff options
author | Pharap <2933055+Pharap@users.noreply.github.com> | 2018-08-18 09:09:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-18 09:09:15 +0100 |
commit | c6ce36d56cd5e874e60c3ba8a36cc77c307df718 (patch) | |
tree | 73562226d18a76936e479f97d9c2385ac5b49e57 /cores/arduino | |
parent | b7c607663fecc232e598f2c0acf419ceb0b7078c (diff) |
Add placement new operator
Diffstat (limited to 'cores/arduino')
-rw-r--r-- | cores/arduino/new.cpp | 4 | ||||
-rw-r--r-- | cores/arduino/new.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/cores/arduino/new.cpp b/cores/arduino/new.cpp index cf6f89c..bfb219d 100644 --- a/cores/arduino/new.cpp +++ b/cores/arduino/new.cpp @@ -26,6 +26,10 @@ void *operator new[](size_t size) { return malloc(size); } +void * operator new(size_t size, void * ptr) { + return ptr; +} + void operator delete(void * ptr) { free(ptr); } diff --git a/cores/arduino/new.h b/cores/arduino/new.h index 6e1b68f..7690911 100644 --- a/cores/arduino/new.h +++ b/cores/arduino/new.h @@ -23,6 +23,7 @@ void * operator new(size_t size); void * operator new[](size_t size); +void * operator new(size_t size, void * ptr); void operator delete(void * ptr); void operator delete[](void * ptr); |