=== modified file 'uspace/Makefile.common'
--- uspace/Makefile.common	2016-05-22 19:50:03 +0000
+++ uspace/Makefile.common	2016-07-08 12:37:31 +0000
@@ -205,7 +205,7 @@
 ifeq ($(CONFIG_OPTIMIZE_FOR_SIZE),y)
 	OPTIMIZATION = s
 else
-	OPTIMIZATION = 3
+	OPTIMIZATION = 0 
 endif
 
 # PCUT-based unit tests

=== modified file 'uspace/app/fdisk/fdisk.c'
--- uspace/app/fdisk/fdisk.c	2015-11-18 09:47:19 +0000
+++ uspace/app/fdisk/fdisk.c	2016-07-08 12:37:31 +0000
@@ -1031,7 +1031,7 @@
 
 int main(int argc, char *argv[])
 {
-	service_id_t svcid;
+	service_id_t svcid = 0;
 	fdisk_dev_t *dev;
 	int rc;
 

=== modified file 'uspace/lib/c/generic/io/log.c'
--- uspace/lib/c/generic/io/log.c	2015-08-23 12:50:23 +0000
+++ uspace/lib/c/generic/io/log.c	2016-07-08 12:37:31 +0000
@@ -242,7 +242,11 @@
 	if (message_buffer == NULL)
 		return;
 
-	vsnprintf(message_buffer, MESSAGE_BUFFER_SIZE, fmt, args);
+	int cnt;
+
+	cnt = vsnprintf(message_buffer, MESSAGE_BUFFER_SIZE, fmt, args);
+
+	assert(cnt <= MESSAGE_BUFFER_SIZE);
 	logger_message(logger_session, ctx, level, message_buffer);
 	free(message_buffer);
 }

=== modified file 'uspace/lib/c/generic/libc.c'
--- uspace/lib/c/generic/libc.c	2016-05-22 17:46:10 +0000
+++ uspace/lib/c/generic/libc.c	2016-07-08 12:37:31 +0000
@@ -138,6 +138,7 @@
 
 void abort(void)
 {
+	*(int *)0x123 = 0x456;
 	__SYSCALL1(SYS_TASK_EXIT, true);
 	
 	/* Unreachable */

=== modified file 'uspace/lib/c/generic/malloc.c'
--- uspace/lib/c/generic/malloc.c	2014-10-09 15:03:55 +0000
+++ uspace/lib/c/generic/malloc.c	2016-07-08 12:37:31 +0000
@@ -296,6 +296,9 @@
 	head->area = area;
 	head->magic = HEAP_BLOCK_HEAD_MAGIC;
 	
+	if (free)
+		memset((void *) &head[1], 0xee, NET_SIZE(size));
+
 	heap_block_foot_t *foot = BLOCK_FOOT(head);
 	
 	foot->size = size;
@@ -311,6 +314,7 @@
  * @param addr Address of the block.
  *
  */
+#include <io/kio.h>
 static void block_check(void *addr)
 {
 	heap_block_head_t *head = (heap_block_head_t *) addr;
@@ -320,6 +324,9 @@
 	heap_block_foot_t *foot = BLOCK_FOOT(head);
 	
 	malloc_assert(foot->magic == HEAP_BLOCK_FOOT_MAGIC);
+	if (head->size != foot->size) {
+		kio_printf("head=%p, foot=%p, foot-head=%u, head->size=%u, foot->size=%u\n", head, foot, (void *) foot - (void *) head, head->size, foot->size);
+	}
 	malloc_assert(head->size == foot->size);
 }
 
@@ -353,7 +360,7 @@
 	/* Align the heap area size on page boundary */
 	size_t asize = ALIGN_UP(size, PAGE_SIZE);
 	void *astart = as_area_create(AS_AREA_ANY, asize,
-	    AS_AREA_WRITE | AS_AREA_READ | AS_AREA_CACHEABLE);
+	    AS_AREA_WRITE | AS_AREA_READ | AS_AREA_CACHEABLE | AS_AREA_GUARD);
 	if (astart == AS_MAP_FAILED)
 		return false;
 	
@@ -394,6 +401,7 @@
  */
 static bool area_grow(heap_area_t *area, size_t size)
 {
+	return false;
 	if (size == 0)
 		return true;
 	
@@ -792,6 +800,7 @@
 	 */
 	size_t gross_size = GROSS_SIZE(ALIGN_UP(size, BASE_ALIGN));
 	
+#if 0
 	/* Try the next fit approach */
 	heap_block_head_t *split = next_fit;
 	
@@ -815,6 +824,7 @@
 		if (addr != NULL)
 			return addr;
 	}
+#endif
 	
 	/* Finally, try to grow heap space and allocate in the new area. */
 	return heap_grow_and_alloc(gross_size, falign);
@@ -851,6 +861,7 @@
 {
 	heap_lock();
 	void *block = malloc_internal(size, BASE_ALIGN);
+	memset(block, 0xde, size);
 	heap_unlock();
 
 	return block;
@@ -874,6 +885,7 @@
 
 	heap_lock();
 	void *block = malloc_internal(size, palign);
+	memset(block, 0xde, size);
 	heap_unlock();
 
 	return block;
@@ -891,7 +903,6 @@
 {
 	if (addr == NULL)
 		return malloc(size);
-	
 	heap_lock();
 	
 	/* Calculate the position of the header. */
@@ -908,9 +919,10 @@
 	malloc_assert((void *) head < area->end);
 	
 	void *ptr = NULL;
-	bool reloc = false;
-	size_t real_size = GROSS_SIZE(ALIGN_UP(size, BASE_ALIGN));
+//	bool reloc = false;
+//	size_t real_size = GROSS_SIZE(ALIGN_UP(size, BASE_ALIGN));
 	size_t orig_size = head->size;
+#if 0	
 	
 	if (orig_size > real_size) {
 		/* Shrink */
@@ -949,15 +961,15 @@
 			reloc = true;
 	}
 	
+#endif
 	heap_unlock();
-	
-	if (reloc) {
+//	if (reloc) {
 		ptr = malloc(size);
 		if (ptr != NULL) {
 			memcpy(ptr, addr, NET_SIZE(orig_size));
 			free(addr);
 		}
-	}
+//	}
 	
 	return ptr;
 }

=== modified file 'uspace/srv/devman/devtree.c'
--- uspace/srv/devman/devtree.c	2013-09-10 19:10:09 +0000
+++ uspace/srv/devman/devtree.c	2016-07-08 12:37:31 +0000
@@ -43,7 +43,7 @@
 
 static inline size_t handle_key_hash(void *key)
 {
-	devman_handle_t handle = *(devman_handle_t*)key;
+	devman_handle_t handle = *((devman_handle_t *) key);
 	return handle;
 }
 
@@ -61,21 +61,21 @@
 
 static bool devman_devices_key_equal(void *key, const ht_link_t *item)
 {
-	devman_handle_t handle = *(devman_handle_t*)key;
+	devman_handle_t handle = *((devman_handle_t *) key);
 	dev_node_t *dev = hash_table_get_inst(item, dev_node_t, devman_dev);
 	return dev->handle == handle;
 }
 
 static bool devman_functions_key_equal(void *key, const ht_link_t *item)
 {
-	devman_handle_t handle = *(devman_handle_t*)key;
+	devman_handle_t handle = *((devman_handle_t *) key);
 	fun_node_t *fun = hash_table_get_inst(item, fun_node_t, devman_fun);
 	return fun->handle == handle;
 }
 
 static inline size_t service_id_key_hash(void *key)
 {
-	service_id_t service_id = *(service_id_t*)key;
+	service_id_t service_id = *((service_id_t *) key);
 	return service_id;
 }
 
@@ -87,7 +87,7 @@
 
 static bool loc_functions_key_equal(void *key, const ht_link_t *item)
 {
-	service_id_t service_id = *(service_id_t*)key;
+	service_id_t service_id = *((service_id_t *) key);
 	fun_node_t *fun = hash_table_get_inst(item, fun_node_t, loc_fun);
 	return fun->service_id == service_id;
 }

