本文整理匯總了C++中DirectoryEntry::setInvalidated方法的典型用法代碼示例。如果您正苦於以下問題:C++ DirectoryEntry::setInvalidated方法的具體用法?C++ DirectoryEntry::setInvalidated怎麽用?C++ DirectoryEntry::setInvalidated使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DirectoryEntry
的用法示例。
在下文中一共展示了DirectoryEntry::setInvalidated方法的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 ); )
}