Index: arch/amd64/include/mm/frame.h
===================================================================
--- arch/amd64/include/mm/frame.h	(revision d6dcdd2ec6546761c2c88f03f7aa39cafdeed5e4)
+++ arch/amd64/include/mm/frame.h	(revision 01e48c1387955316bc770ea13559724e5f0138b1)
@@ -1,4 +1,4 @@
 /*
- * Copyright (C) 2005 Martin Decky
+ * Copyright (C) 2005 Ondrej Palkovsky
  * All rights reserved.
  *
Index: arch/amd64/include/mm/page.h
===================================================================
--- arch/amd64/include/mm/page.h	(revision d6dcdd2ec6546761c2c88f03f7aa39cafdeed5e4)
+++ arch/amd64/include/mm/page.h	(revision 01e48c1387955316bc770ea13559724e5f0138b1)
@@ -1,4 +1,4 @@
 /*
- * Copyright (C) 2005 Martin Decky
+ * Copyright (C) 2005 Ondrej Palkovsky
  * All rights reserved.
  *
Index: arch/amd64/include/mm/vm.h
===================================================================
--- arch/amd64/include/mm/vm.h	(revision d6dcdd2ec6546761c2c88f03f7aa39cafdeed5e4)
+++ arch/amd64/include/mm/vm.h	(revision 01e48c1387955316bc770ea13559724e5f0138b1)
@@ -1,4 +1,4 @@
 /*
- * Copyright (C) 2005 Martin Decky
+ * Copyright (C) 2005 Ondrej Palkovsky
  * All rights reserved.
  *
Index: arch/ia32/src/acpi/madt.c
===================================================================
--- arch/ia32/src/acpi/madt.c	(revision d6dcdd2ec6546761c2c88f03f7aa39cafdeed5e4)
+++ arch/ia32/src/acpi/madt.c	(revision 01e48c1387955316bc770ea13559724e5f0138b1)
@@ -113,14 +113,12 @@
 int madt_cmp(void * a, void * b) 
 {
-    return 
-	(((struct madt_apic_header *) a)->type > ((struct madt_apic_header *) b)->type) ?
-	1 : 
-	((((struct madt_apic_header *) a)->type < ((struct madt_apic_header *) b)->type) ? -1 : 0);
+	return 
+		(((struct madt_apic_header *) a)->type > ((struct madt_apic_header *) b)->type) ?
+		1 : 
+		((((struct madt_apic_header *) a)->type < ((struct madt_apic_header *) b)->type) ? -1 : 0);
 }
 	
 void acpi_madt_parse(void)
 {
-
-
 	struct madt_apic_header *end = (struct madt_apic_header *) (((__u8 *) acpi_madt) + acpi_madt->header.length);
 	struct madt_apic_header *h;
Index: src/lib/sort.c
===================================================================
--- src/lib/sort.c	(revision d6dcdd2ec6546761c2c88f03f7aa39cafdeed5e4)
+++ src/lib/sort.c	(revision 01e48c1387955316bc770ea13559724e5f0138b1)
@@ -32,4 +32,6 @@
 #include <panic.h>
 
+#define EBUFSIZE	32
+
 static void _qsort(void * data, count_t n, size_t e_size, int (* cmp) (void * a, void * b), void * pivot, void * tmp);
 
@@ -38,22 +40,40 @@
  */
 void qsort(void * data, count_t n, size_t e_size, int (* cmp) (void * a, void * b)) {
-	void * tmp = (void *) malloc(e_size);
-	void * pivot = (void *) malloc(e_size);
+	__u8 buf_tmp[EBUFSIZE];
+	__u8 buf_pivot[EBUFSIZE];
+	void * tmp = buf_tmp;
+	void * pivot = buf_pivot;
+
+	if (e_size > EBUFSIZE) {
+		pivot = (void *) malloc(e_size);
+		tmp = (void *) malloc(e_size);
 	
-	if (!tmp || !pivot) {
-		panic("Cannot allocate memory\n");
+		if (!tmp || !pivot) {
+			panic("Cannot allocate memory\n");
+		}
 	}
 
 	_qsort(data, n, e_size, cmp, pivot, tmp);
 	
-	free(tmp);
-	free(pivot);
+	if (e_size > EBUFSIZE) {
+		free(tmp);
+		free(pivot);
+	}
 }
 
 
 void bubblesort(void * data, count_t n, size_t e_size, int (* cmp) (void * a, void * b)) {
+	__u8 buf_slot[EBUFSIZE];
 	bool done = false;
 	void * p;
-	void * slot = (void *) malloc(e_size);
+	void * slot = buf_slot;
+	
+	if (e_size > EBUFSIZE) {
+		slot = (void *) malloc(e_size);
+		
+		if (!slot) {
+			panic("Cannot allocate memory\n");
+		}
+	}
 
 	while (!done) {
@@ -69,5 +89,7 @@
 	}
 	
-	free(slot);
+	if (e_size > EBUFSIZE) {	
+		free(slot);
+	}
 }
 
