作者DevilAndrew (交程式? 停修單?)
看板EE_DSnP
標題[請益] freeArr 中的 p 和 r
時間Sat Dec 16 23:26:09 2006
在測試程式的動作
mtest> mtn 1 -a 5
Calling allocArr...(64)
Calling MemMgr::getMem...(64)
Memory acquired... 0x9264c30
mtest> mtd -i 0 -a
Calling freeArr...(0x9264c30)
>> Array size = 5
Recycling 0x9264c30 to (5)
下面是 code 對應的部分
( 但 r 不是應該在 p 前面 4 bytes 嗎 ? 還是我搞錯了@@)
cout << "Calling freeArr...(" << p << ")" << endl;
// 2. Get 'r' which points to the beginning of the memory element and
// is the memory address to recycle
cout << "Recycling " << r << " to (" << n << ")" << endl;
--
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 219.87.129.152
推 ric2k1:"Memory acquired... 0x9264c30" 以及 12/16 23:50
推 ric2k1:"Recycling 0x9264c30 to (5)" 12/16 23:50
→ ric2k1:"ret" 與 "r" 都是指 p 前面 4 bytes 12/16 23:51