diff options
Diffstat (limited to 'db/pdfile.h')
-rw-r--r-- | db/pdfile.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/db/pdfile.h b/db/pdfile.h index 084a542..d268aac 100644 --- a/db/pdfile.h +++ b/db/pdfile.h @@ -79,6 +79,8 @@ namespace mongo { void flush( bool sync ); private: + void badOfs(int) const; + int defaultSize( const char *filename ) const; Extent* getExtent(DiskLoc loc); @@ -255,6 +257,8 @@ namespace mongo { Extent* getPrevExtent() { return xprev.isNull() ? 0 : DataFileMgr::getExtent(xprev); } + + static int maxSize(); }; /* @@ -339,7 +343,7 @@ namespace mongo { inline Record* MongoDataFile::recordAt(DiskLoc dl) { int ofs = dl.getOfs(); - assert( ofs >= DataFileHeader::HeaderSize ); + if( ofs < DataFileHeader::HeaderSize ) badOfs(ofs); // will uassert - external call to keep out of the normal code path return (Record*) _p.at(ofs, -1); } |