Avoid key's with value 0

上级 1db560a8
...@@ -48,6 +48,7 @@ nsalloc(void) ...@@ -48,6 +48,7 @@ nsalloc(void)
memset(ns, 0, sizeof(struct ns)); memset(ns, 0, sizeof(struct ns));
snprintf(ns->name, sizeof(ns->name), "ns:%x", ns); snprintf(ns->name, sizeof(ns->name), "ns:%x", ns);
initlock(&ns->lock, ns->name); initlock(&ns->lock, ns->name);
ns->nextkey = 1;
for (int i = 0; i < NHASH; i++) for (int i = 0; i < NHASH; i++)
TAILQ_INIT(&ns->table[i].chain); TAILQ_INIT(&ns->table[i].chain);
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论