From 6b146e80e1841b0a8c9788b2bbb9b7c16a158f6d Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 14 Oct 2009 00:49:47 +0200 Subject: More restrictive requirements on zone alignment kern/zalloc.c (zinit): Panic if requested alignment doesn't match page size and list elements. --- kern/zalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kern') 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); } -- cgit v1.2.3