本文整理汇总了C++中DirectoryEntry::setOwner方法的典型用法代码示例。如果您正苦于以下问题:C++ DirectoryEntry::setOwner方法的具体用法?C++ DirectoryEntry::setOwner怎么用?C++ DirectoryEntry::setOwner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DirectoryEntry
的用法示例。
在下文中一共展示了DirectoryEntry::setOwner方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: registerCacheAccess
inline void CachePolicy::registerCacheAccess( Directory& dir, uint64_t tag, size_t size, bool input, bool output )
{
bool didCopyIn = false;
CacheEntry *ce;
ce = _cache.getEntry( tag );
unsigned int version=0;
if ( ce != NULL ) version = ce->getVersion()+1;
DirectoryEntry *de = dir.getEntry( tag, version );
if ( de == NULL ) { // Memory access not registered in the directory
bool inserted;
DirectoryEntry d = DirectoryEntry( tag, 0, ( output ? &_cache : NULL ), dir.getCacheMapSize() );
de = &(dir.insert( tag, d, inserted ));
if (!inserted) {
if ( output ) {
de->setOwner(&_cache);
de->setInvalidated(false);
ce->setFlushTo( &dir );
}
}
CacheEntry c = CacheEntry( NULL, size, tag, 0, output, input );
ce = &(_cache.insert( tag, c, inserted ));
if (inserted) { // allocate it
ce->setAddress( _cache.allocate( dir, size , tag) );
ce->setAllocSize( size );
if (input) {
CopyDescriptor cd = CopyDescriptor(tag);
if ( _cache.copyDataToCache( cd, size ) ) {
ce->setCopying(false);
}
}
} else { // wait for address
NANOS_INSTRUMENT( sys.getInstrumentation()->raiseOpenBurstEvent ( sys.getInstrumentation()->getInstrumentationDictionary()->getEventKey( "cache-wait" ), NANOS_CACHE_EVENT_REGISTER_CACHE_ACCESS_94 ); )
while ( ce->getAddress() == NULL ) {}
NANOS_INSTRUMENT( sys.getInstrumentation()->raiseCloseBurstEvent ( sys.getInstrumentation()->getInstrumentationDictionary()->getEventKey( "cache-wait" ), 0 ); )
}