Index: uspace/lib/c/generic/malloc.c
===================================================================
--- uspace/lib/c/generic/malloc.c	(revision 3292623d2c53a7386c3a2e4d98465ae659411b56)
+++ uspace/lib/c/generic/malloc.c	(revision fc4788545f82a1def816a3bc5940db8c6f0c1a9f)
@@ -45,4 +45,5 @@
 #include <futex.h>
 #include <adt/gcdlcm.h>
+#include "private/malloc.h"
 
 /* Magic used in heap headers. */
@@ -215,25 +216,22 @@
 /** Initialize the heap allocator
  *
- * Find how much physical memory we have and create
- * the heap management structures that mark the whole
- * physical memory as a single free block.
- *
- */
-void __heap_init(void)
-{
-	futex_down(&malloc_futex);
-	
-	if (as_area_create((void *) &_heap, PAGE_SIZE,
-	    AS_AREA_WRITE | AS_AREA_READ)) {
-		heap_pages = 1;
-		heap_start = (void *) ALIGN_UP((uintptr_t) &_heap, BASE_ALIGN);
-		heap_end =
-		    (void *) ALIGN_DOWN(((uintptr_t) &_heap) + PAGE_SIZE, BASE_ALIGN);
-		
-		/* Make the entire area one large block. */
-		block_init(heap_start, heap_end - heap_start, true);
-	}
-	
-	futex_up(&malloc_futex);
+ * Create initial heap memory area. This routine is
+ * only called from libc initialization, thus we do not
+ * take any locks.
+ *
+ */
+void __malloc_init(void)
+{
+	if (!as_area_create((void *) &_heap, PAGE_SIZE,
+	    AS_AREA_WRITE | AS_AREA_READ))
+		abort();
+	
+	heap_pages = 1;
+	heap_start = (void *) ALIGN_UP((uintptr_t) &_heap, BASE_ALIGN);
+	heap_end =
+	    (void *) ALIGN_DOWN(((uintptr_t) &_heap) + PAGE_SIZE, BASE_ALIGN);
+	
+	/* Make the entire area one large block. */
+	block_init(heap_start, heap_end - heap_start, true);
 }
 
