提交 d3adb158 创建 作者: David Benjamin's avatar David Benjamin

Dead pointers do not own references

Otherwise they'll bounce on reference counts.
上级 d029a831
......@@ -44,7 +44,7 @@ class radix_node;
* unlocked when the radix_range goes away.
*
* Once a pointer is dead, it stays dead until the containing
* radix_node is deallocated.
* radix_node is deallocated. Dead pointers do not own references.
*
* Races:
*
......
......@@ -60,7 +60,9 @@ radix_entry::release()
if (is_null()) return;
if (is_node()) {
node()->do_gc();
} else {
} else if (state() != entry_dead) {
// Only decref live pointers. Dead ones are part of pages which
// were RCU-freed and no longer own references.
elem()->decref();
}
}
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论