作者EEmuse2 (忘了密码)
看板EE_DSnP
标题Re: [问题] mtn
时间Sat Dec 16 13:02:45 2006
※ 引述《EEmuse2 (忘了密码)》之铭言:
: 我在测试程式後
: 输入mtn 1 -a 256可以执行
: 回收出现记忆体程式区段错误
: 另外在mtn 10 -a 256也会出现
: 想请教大家有没有相关的想法??
: 感谢!
: 有想过可能是renew memBlock的问题
: 但我测试一下是ok的...
恩没错 我也是用ddd抓到getList的问题
if( (*this)._arrSize==n)
return this;
if((*this)._nextList==0)
return _nextList=new MemRecycleList<T>(n);
else (*this)._nextList->getList(n);
我是在getMem检查传回的list有没有可以回收的ptr
但我只要new两块以上255up的arr
第二块会找到list而且里面有东西
所以一pop报掉了...
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.121.192.95
1F:→ EEmuse2:e感觉pop没错..因为其他都没问题..? 12/16 13:10
2F:→ EEmuse2:好像知道错在哪了... 12/16 13:54