提交 3597d5dc 创建 作者: Robert Morris's avatar Robert Morris

oops. last minute simplicifaction to kalloc().

上级 1aee6a6c
...@@ -24,10 +24,9 @@ kinit(void) ...@@ -24,10 +24,9 @@ kinit(void)
extern char end[]; extern char end[];
initlock(&kmem.lock, "kmem"); initlock(&kmem.lock, "kmem");
char *p1 = (char*)PGROUNDUP((uint)end); char *p = (char*)PGROUNDUP((uint)end);
char *p2 = PGROUNDDOWN(PHYSTOP); for( ; p + PGSIZE - 1 < (char*) PHYSTOP; p += PGSIZE)
for( ; p1 < p2; p1 += 4096) kfree(p);
kfree(p1);
} }
// Free the page of physical memory pointed at by v, // Free the page of physical memory pointed at by v,
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论