作者dryman (dryman)
看板EE_DSnP
标题[问题] ~f及_one/_zero
时间Wed Jan 20 05:09:21 2010
else if (f == ~h) h = BddNode::_one;
我想请问在这种情况下有没有可能造成_one的reference count减少?
因为我看到我的程式
(gdb) p BddNodeInt::_terminal._refCount
$1 = 1
(gdb)
往上追会看到这一行...orz
else if (f == ~h) h = BddNode::_one;
operator =
若_nodeV为零就更新_nodeV,再incRefCount
若_nodeV不为零,则删除原_nodeV指向的bddnodeint的refcount
再更新_nodeV,incRefcount
如果delete的话程式就会crash,不delete又会跑很慢orz
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.4.195
※ 编辑: dryman 来自: 140.112.4.195 (01/20 05:11)
1F:推 a3785lexx:爆肝推一个!! 01/20 05:17
2F:推 hrs113355:爆肝推一个++ 01/20 06:23
3F:推 angelicdream: 推一个 科科 01/20 07:45
4F:推 ric2k1:If h is a support, then the refCount to _one will -- 01/20 08:03
5F:推 ric2k1:不 delete 跑很慢不一定是因为不 delete 的关系... 01/20 08:04