提交 fe9d6c9d 创建 作者: Austin Clements's avatar Austin Clements

Debug code to check that zalloc is returning zeroed pages

上级 c11e2ec0
...@@ -82,6 +82,9 @@ zallocator::alloc(const char* name) ...@@ -82,6 +82,9 @@ zallocator::alloc(const char* name)
} else { } else {
// Zero the run header used by kmem // Zero the run header used by kmem
memset(p, 0, sizeof(struct run)); memset(p, 0, sizeof(struct run));
if (0)
for (int i = 0; i < PGSIZE; i++)
assert(p[i] == 0);
} }
tryrefill(); tryrefill();
return p; return p;
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论