我想找到此函数执行的次数。抄送文件中的功能是:
CacheSetLRU::CacheSetLRU(
CacheBase::cache_t cache_type,
UInt32 associativity, UInt32 blocksize, CacheSetInfoLRU* set_info, UInt8 num_attempts)
: CacheSet(cache_type, associativity, blocksize)
, m_num_attempts(num_attempts)
, m_set_info(set_info)
{
m_lru_bits = new UInt8[m_associativity];
for (UInt32 i = 0; i < m_associativity; i++)
m_lru_bits[i] = i;
}
相关的头文件具有以下几行:
class CacheSetLRU : public CacheSet
{
public:
CacheSetLRU(CacheBase::cache_t cache_type,
UInt32 associativity, UInt32 blocksize, CacheSetInfoLRU* set_info, UInt8 num_attempts);
virtual ~CacheSetLRU();
virtual UInt32 getReplacementIndex(CacheCntlr *cntlr);
void updateReplacementIndex(UInt32 accessed_index);
protected:
const UInt8 m_num_attempts;
UInt8* m_lru_bits;
CacheSetInfoLRU* m_set_info;
void moveToMRU(UInt32 accessed_index);
};
我确实声明了一个静态整数,并使用cout取得了数字,但我只想要最后一个数字,而我不知道该怎么做。我已经搜索并挖掘了每个论坛,但是这些方法并未在我的代码中得出结果。该代码是开源模拟器核心代码的一部分。 任何帮助或暗示将不胜感激。