RegionDesc::Block::Block(const Func* func, bool resumed, Offset start, int length, FPInvOffset initSpOff, uint16_t inlineLevel) : m_id(s_nextId--) , m_func(func) , m_resumed(resumed) , m_start(start) , m_last(kInvalidOffset) , m_length(length) , m_initialSpOffset(initSpOff) , m_inlinedCallee(nullptr) , m_inlineLevel(inlineLevel) { assertx(length >= 0); if (length > 0) { SrcKey sk(func, start, resumed); for (unsigned i = 1; i < length; ++i) sk.advance(); m_last = sk.offset(); } checkInstructions(); checkMetadata(); }
RegionDesc::Block::Block(const Func* func, Offset start, int length) : m_func(func) , m_start(start) , m_last(kInvalidOffset) , m_length(length) , m_inlinedCallee(nullptr) { assert(length >= 0); if (length > 0) { SrcKey sk(func, start); for (unsigned i = 1; i < length; ++i) sk.advance(); m_last = sk.offset(); } checkInstructions(); checkMetadata(); }
QgsSqliteHandle *QgsSqliteHandle::openDb( const QString &dbPath, bool shared ) { sqlite3 *sqlite_handle = nullptr; //QMap < QString, QgsSqliteHandle* >&handles = QgsSqliteHandle::handles; if ( shared && sHandles.contains( dbPath ) ) { QgsDebugMsg( QString( "Using cached connection for %1" ).arg( dbPath ) ); sHandles[dbPath]->ref++; return sHandles[dbPath]; } QgsDebugMsg( QString( "New sqlite connection for " ) + dbPath ); if ( QgsSLConnect::sqlite3_open_v2( dbPath.toUtf8().constData(), &sqlite_handle, shared ? SQLITE_OPEN_READWRITE : SQLITE_OPEN_READONLY | SQLITE_OPEN_NOMUTEX, nullptr ) ) { // failure QgsDebugMsg( QString( "Failure while connecting to: %1\n%2" ) .arg( dbPath, QString::fromUtf8( sqlite3_errmsg( sqlite_handle ) ) ) ); return nullptr; } // checking the DB for sanity if ( !checkMetadata( sqlite_handle ) ) { // failure QgsDebugMsg( QString( "Failure while connecting to: %1\n\ninvalid metadata tables" ).arg( dbPath ) ); QgsSLConnect::sqlite3_close( sqlite_handle ); return nullptr; } // activating Foreign Key constraints ( void )sqlite3_exec( sqlite_handle, "PRAGMA foreign_keys = 1", nullptr, 0, nullptr ); QgsDebugMsg( "Connection to the database was successful" ); QgsSqliteHandle *handle = new QgsSqliteHandle( sqlite_handle, dbPath, shared ); if ( shared ) sHandles.insert( dbPath, handle ); return handle; }
RegionDesc::Block::Block(const Func* func, bool resumed, Offset start, int length, FPInvOffset initSpOff) : m_id(s_nextId.fetch_sub(1, std::memory_order_relaxed)) , m_func(func) , m_resumed(resumed) , m_start(start) , m_last(kInvalidOffset) , m_length(length) , m_initialSpOffset(initSpOff) , m_profTransID(kInvalidTransID) { assertx(length >= 0); if (length > 0) { SrcKey sk(func, start, resumed); for (unsigned i = 1; i < length; ++i) sk.advance(); m_last = sk.offset(); } checkInstructions(); checkMetadata(); }
BOOL StreamTitleDisplay::tick() { checkMetadata(); return false; }