aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranklin Wei <frankhwei536@gmail.com>2015-02-28 20:57:27 -0500
committerFranklin Wei <frankhwei536@gmail.com>2015-02-28 20:57:27 -0500
commitd532ad93a42ea95460765d4527b3fb1e4544c154 (patch)
tree970123c1a8c43ed7665df945ab41d669aa0c48be
parent8304827d1232761764d5e2dfde07fa29b6973c35 (diff)
downloadkappa-d532ad93a42ea95460765d4527b3fb1e4544c154.zip
kappa-d532ad93a42ea95460765d4527b3fb1e4544c154.tar.gz
kappa-d532ad93a42ea95460765d4527b3fb1e4544c154.tar.bz2
kappa-d532ad93a42ea95460765d4527b3fb1e4544c154.tar.xz
fix logic bug
-rw-r--r--kernel/heap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/heap.c b/kernel/heap.c
index 947d0db..bb18fb4 100644
--- a/kernel/heap.c
+++ b/kernel/heap.c
@@ -20,7 +20,8 @@ static void *kmalloc_int(size_t sz, int align, void **phys)
*phys = (void*)kmalloc_addr;
void *ret = (void*)kmalloc_addr;
kmalloc_addr += sz;
- assert(((uint32_t)ret & 0xFFF) == 0);
+ /* make sure the address is aligned if requested */
+ assert(!align || (((uint32_t)ret & 0xFFF) == 0));
return ret;
}