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

Always give kalloc's a label

I hadn't realized before that mscan tracks "block" labels and "type" labels separately and prefers type labels over block labels. So, in fact, kalloc's should always be labeled (using block labels) and suballocations from these blocks should also be labeled (using type labels).
上级 0d6716d9
...@@ -128,7 +128,6 @@ kmem::alloc(const char* name) ...@@ -128,7 +128,6 @@ kmem::alloc(const char* name)
panic("kmem:alloc: aba race %p %p %p\n", panic("kmem:alloc: aba race %p %p %p\n",
r, r->next, nxt); r, r->next, nxt);
nfree--; nfree--;
if (name)
mtlabel(mtrace_label_block, r, size, name, strlen(name)); mtlabel(mtrace_label_block, r, size, name, strlen(name));
return r; return r;
} }
......
...@@ -37,7 +37,7 @@ kminit(void) ...@@ -37,7 +37,7 @@ kminit(void)
static int static int
morecore(int c, int b) morecore(int c, int b)
{ {
char *p = kalloc(nullptr); char *p = kalloc("kmalloc");
if(p == 0) if(p == 0)
return -1; return -1;
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论