本文整理汇总了C++中MongoFile::isMongoMMF方法的典型用法代码示例。如果您正苦于以下问题:C++ MongoFile::isMongoMMF方法的具体用法?C++ MongoFile::isMongoMMF怎么用?C++ MongoFile::isMongoMMF使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MongoFile
的用法示例。
在下文中一共展示了MongoFile::isMongoMMF方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: debugValidateMapsMatch
/** (SLOW) diagnostic to check that the private view and the non-private view are in sync.
*/
static void debugValidateMapsMatch() {
if( !DebugValidateMapsMatch )
return;
Timer t;
set<MongoFile*>& files = MongoFile::getAllFiles();
for( set<MongoFile*>::iterator i = files.begin(); i != files.end(); i++ ) {
MongoFile *mf = *i;
if( mf->isMongoMMF() ) {
MongoMMF *mmf = (MongoMMF*) mf;
const char *p = (const char *) mmf->getView();
const char *w = (const char *) mmf->view_write();
unsigned low = 0xffffffff;
unsigned high = 0;
for( unsigned i = 0; i < mmf->length(); i++ ) {
if( p[i] != w[i] ) {
log() << i << '\t' << (int) p[i] << '\t' << (int) w[i] << endl;
if( i < low ) low = i;
if( i > high ) high = i;
}
}
if( low != 0xffffffff ) {
std::stringstream ss;
ss << "dur error warning views mismatch " << mmf->filename() << ' ' << (hex) << low << ".." << high << " len:" << high-low+1;
log() << ss.str() << endl;
log() << "priv loc: " << (void*)(p+low) << endl;
vector<WriteIntent>& w = commitJob.writes();
(void)w; // mark as unused. Useful for inspection in debugger
breakpoint();
}
}
}
log() << "debugValidateMapsMatch " << t.millis() << "ms " << endl;
}