Index: uspace/lib/c/generic/assert.c
===================================================================
--- uspace/lib/c/generic/assert.c	(revision 0c33b1d5be2221765dabe9e2b48eb3936a0f1464)
+++ uspace/lib/c/generic/assert.c	(revision 955f2a57490a386f4fbaee3277e4bd761f17dd29)
@@ -33,4 +33,5 @@
 #include <assert.h>
 #include <stdio.h>
+#include <io/klog.h>
 #include <stdlib.h>
 #include <stacktrace.h>
@@ -44,4 +45,10 @@
 }
 
+void assert_static_abort(const char *msg)
+{
+	klog_write(msg, str_size(msg));
+	abort();
+}
+
 /** @}
  */
Index: uspace/lib/c/generic/malloc.c
===================================================================
--- uspace/lib/c/generic/malloc.c	(revision 0c33b1d5be2221765dabe9e2b48eb3936a0f1464)
+++ uspace/lib/c/generic/malloc.c	(revision 955f2a57490a386f4fbaee3277e4bd761f17dd29)
@@ -119,13 +119,4 @@
 	    (((uintptr_t) (head)) + (head)->size - sizeof(heap_block_foot_t)))
 
-#define malloc_assert(expr) \
-	do { \
-		if (!(expr)) {\
-			futex_up(&malloc_futex); \
-			assert((expr)); \
-		} \
-	} while (0)
-
-
 /** Heap area.
  *
@@ -237,10 +228,10 @@
 	heap_block_head_t *head = (heap_block_head_t *) addr;
 	
-	malloc_assert(head->magic == HEAP_BLOCK_HEAD_MAGIC);
+	assert_static(head->magic == HEAP_BLOCK_HEAD_MAGIC);
 	
 	heap_block_foot_t *foot = BLOCK_FOOT(head);
 	
-	malloc_assert(foot->magic == HEAP_BLOCK_FOOT_MAGIC);
-	malloc_assert(head->size == foot->size);
+	assert_static(foot->magic == HEAP_BLOCK_FOOT_MAGIC);
+	assert_static(head->size == foot->size);
 }
 
@@ -256,9 +247,9 @@
 	heap_area_t *area = (heap_area_t *) addr;
 	
-	malloc_assert(area->magic == HEAP_AREA_MAGIC);
-	malloc_assert(addr == area->start);
-	malloc_assert(area->start < area->end);
-	malloc_assert(((uintptr_t) area->start % PAGE_SIZE) == 0);
-	malloc_assert(((uintptr_t) area->end % PAGE_SIZE) == 0);
+	assert_static(area->magic == HEAP_AREA_MAGIC);
+	assert_static(addr == area->start);
+	assert_static(area->start < area->end);
+	assert_static(((uintptr_t) area->start % PAGE_SIZE) == 0);
+	assert_static(((uintptr_t) area->end % PAGE_SIZE) == 0);
 }
 
@@ -391,5 +382,5 @@
 	
 	block_check((void *) last_head);
-	malloc_assert(last_head->area == area);
+	assert_static(last_head->area == area);
 	
 	if (last_head->free) {
@@ -404,5 +395,5 @@
 		
 		block_check((void *) first_head);
-		malloc_assert(first_head->area == area);
+		assert_static(first_head->area == area);
 		
 		size_t shrink_size = ALIGN_DOWN(last_head->size, PAGE_SIZE);
@@ -506,5 +497,5 @@
 static void split_mark(heap_block_head_t *cur, const size_t size)
 {
-	malloc_assert(cur->size >= size);
+	assert_static(cur->size >= size);
 	
 	/* See if we should split the block. */
@@ -542,6 +533,6 @@
 {
 	area_check((void *) area);
-	malloc_assert((void *) first_block >= (void *) AREA_FIRST_BLOCK_HEAD(area));
-	malloc_assert((void *) first_block < area->end);
+	assert_static((void *) first_block >= (void *) AREA_FIRST_BLOCK_HEAD(area));
+	assert_static((void *) first_block < area->end);
 	
 	for (heap_block_head_t *cur = first_block; (void *) cur < area->end;
@@ -670,5 +661,5 @@
 static void *malloc_internal(const size_t size, const size_t align)
 {
-	malloc_assert(first_heap_area != NULL);
+	assert_static(first_heap_area != NULL);
 	
 	if (align == 0)
@@ -795,11 +786,11 @@
 	
 	block_check(head);
-	malloc_assert(!head->free);
+	assert_static(!head->free);
 	
 	heap_area_t *area = head->area;
 	
 	area_check(area);
-	malloc_assert((void *) head >= (void *) AREA_FIRST_BLOCK_HEAD(area));
-	malloc_assert((void *) head < area->end);
+	assert_static((void *) head >= (void *) AREA_FIRST_BLOCK_HEAD(area));
+	assert_static((void *) head < area->end);
 	
 	void *ptr = NULL;
@@ -872,11 +863,11 @@
 	
 	block_check(head);
-	malloc_assert(!head->free);
+	assert_static(!head->free);
 	
 	heap_area_t *area = head->area;
 	
 	area_check(area);
-	malloc_assert((void *) head >= (void *) AREA_FIRST_BLOCK_HEAD(area));
-	malloc_assert((void *) head < area->end);
+	assert_static((void *) head >= (void *) AREA_FIRST_BLOCK_HEAD(area));
+	assert_static((void *) head < area->end);
 	
 	/* Mark the block itself as free. */
Index: uspace/lib/c/include/assert.h
===================================================================
--- uspace/lib/c/include/assert.h	(revision 0c33b1d5be2221765dabe9e2b48eb3936a0f1464)
+++ uspace/lib/c/include/assert.h	(revision 955f2a57490a386f4fbaee3277e4bd761f17dd29)
@@ -55,7 +55,15 @@
 	} while (0)
 
+#define assert_static(expr) \
+	do { \
+		if (!(expr)) \
+			assert_static_abort("Assertion failed (" #expr \
+			    ") in file \"" __FILE__ "\".\n"); \
+	} while (0)
+
 #else /* NDEBUG */
 
 #define assert(expr)
+#define assert_static(expr)
 
 #endif /* NDEBUG */
@@ -63,4 +71,6 @@
 extern void assert_abort(const char *, const char *, unsigned int)
     __attribute__((noreturn));
+extern void assert_static_abort(const char *);
+
 
 #endif
