ST / ST_Events-old

Dependents:   HelloWorld_CCA01M1 HelloWorld_CCA02M1 CI-data-logger-server HelloWorld_CCA02M1 ... more

This is a fork of the events subdirectory of https://github.com/ARMmbed/mbed-os.

Note, you must import this library with import name: events!!!

Revision:
7397:7448008aec84
Parent:
7395:79e8c79e165c
Child:
7575:67b11b21d959
Child:
7514:a0c71f3f3d2f
--- a/hal/common/retarget.cpp	Wed Aug 03 14:28:53 2016 -0500
+++ b/hal/common/retarget.cpp	Mon Aug 01 09:07:35 2016 -0500
@@ -23,6 +23,8 @@
 #include "mbed_interface.h"
 #include "SingletonPtr.h"
 #include "PlatformMutex.h"
+#include "mbed_error.h"
+#include <stdlib.h>
 #if DEVICE_STDIO_MESSAGES
 #include <stdio.h>
 #endif
@@ -724,3 +726,34 @@
 #endif
 
 } // namespace mbed
+
+void *operator new(std::size_t count)
+{
+    void *buffer = malloc(count);
+    if (NULL == buffer) {
+        error("Operator new out of memory\r\n");
+    }
+    return buffer;
+}
+
+void *operator new[](std::size_t count)
+{
+    void *buffer = malloc(count);
+    if (NULL == buffer) {
+        error("Operator new[] out of memory\r\n");
+    }
+    return buffer;
+}
+
+void operator delete(void *ptr)
+{
+    if (ptr != NULL) {
+        free(ptr);
+    }
+}
+void operator delete[](void *ptr)
+{
+    if (ptr != NULL) {
+        free(ptr);
+    }
+}