aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/new
diff options
context:
space:
mode:
Diffstat (limited to 'cores/arduino/new')
-rw-r--r--cores/arduino/new35
1 files changed, 32 insertions, 3 deletions
diff --git a/cores/arduino/new b/cores/arduino/new
index 763f5cc..3599571 100644
--- a/cores/arduino/new
+++ b/cores/arduino/new
@@ -21,11 +21,40 @@
#include <stdlib.h>
+namespace std {
+ struct nothrow_t {};
+ extern const nothrow_t nothrow;
+
+ // These are not actually implemented, to prevent overhead and
+ // complexity. They are still declared to allow implementing
+ // them in user code if needed.
+ typedef void (*new_handler)();
+ new_handler set_new_handler(new_handler new_p) noexcept;
+ new_handler get_new_handler() noexcept;
+} // namespace std
+
void * operator new(size_t size);
void * operator new[](size_t size);
-void * operator new(size_t size, void * ptr) noexcept;
-void operator delete(void * ptr);
-void operator delete[](void * ptr);
+
+void * operator new(size_t size, const std::nothrow_t tag) noexcept;
+void * operator new[](size_t size, const std::nothrow_t& tag) noexcept;
+
+void * operator new(size_t size, void *place) noexcept;
+void * operator new[](size_t size, void *place) noexcept;
+
+void operator delete(void * ptr) noexcept;
+void operator delete[](void * ptr) noexcept;
+
+#if __cplusplus >= 201402L
+void operator delete(void* ptr, size_t size) noexcept;
+void operator delete[](void * ptr, size_t size) noexcept;
+#endif // __cplusplus >= 201402L
+
+void operator delete(void* ptr, const std::nothrow_t& tag) noexcept;
+void operator delete[](void* ptr, const std::nothrow_t& tag) noexcept;
+
+void operator delete(void* ptr, void* place) noexcept;
+void operator delete[](void* ptr, void* place) noexcept;
#endif