summaryrefslogtreecommitdiff
path: root/kern
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2009-10-14 00:49:47 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2009-10-14 00:49:47 +0200
commit6b146e80e1841b0a8c9788b2bbb9b7c16a158f6d (patch)
treefd849d0df659b05fecc41ae2889236ab3af5e417 /kern
parent55c57827e99f067cb8f715b1be78d4822005388c (diff)
More restrictive requirements on zone alignment
kern/zalloc.c (zinit): Panic if requested alignment doesn't match page size and list elements.
Diffstat (limited to 'kern')
-rw-r--r--kern/zalloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kern/zalloc.c b/kern/zalloc.c
index 839e40f..9b3ac4b 100644
--- a/kern/zalloc.c
+++ b/kern/zalloc.c
@@ -214,7 +214,7 @@ zone_t zinit(size, align, max, alloc, memtype, name)
max = alloc;
if (align > 0) {
- if (align >= PAGE_SIZE)
+ if (PAGE_SIZE % align || align % sizeof(z->free_elements))
panic("zinit");
ALIGN_SIZE_UP(size, align);
}