fix bugs found in brk & add simple security checks on lx_free
[lunaix-os.git] / lunaix-os / includes / lunaix / spike.h
index 7e50693bc6fa37e77467078ceb63505c422d121b..076482215cfcea8a8f031cd6f10319a920d428dc 100644 (file)
@@ -24,6 +24,11 @@ inline static void spin() {
     if (!(cond)) {                                    \
         __assert_fail(#cond, __FILE__, __LINE__);     \
     }
+
+#define assert_msg(cond, msg)                         \
+    if (!(cond)) {                                    \
+        __assert_fail(msg, __FILE__, __LINE__);   \
+    }
 void __assert_fail(const char* expr, const char* file, unsigned int line) __attribute__((noinline, noreturn));
 #else
 #define assert(cond) //nothing