Skip to content

Commit

Permalink
make Record::touch not call _accessing
Browse files Browse the repository at this point in the history
  • Loading branch information
erh committed Mar 31, 2012
1 parent d5cb09f commit 9b73925
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/mongo/db/pdfile.h
Expand Up @@ -222,7 +222,7 @@ namespace mongo {
const char * data() const { _accessing(); return _data; }
char * data() { _accessing(); return _data; }

int netLength() const { _accessing(); return _lengthWithHeaders - HeaderSize; }
int netLength() const { _accessing(); return _netLength(); }

/* use this when a record is deleted. basically a union with next/prev fields */
DeletedRecord& asDeleted() { return *((DeletedRecord*) this); }
Expand Down Expand Up @@ -272,6 +272,8 @@ namespace mongo {

private:

int _netLength() const { return _lengthWithHeaders - HeaderSize; }

/**
* call this when accessing a field which could hit disk
*/
Expand Down
2 changes: 1 addition & 1 deletion src/mongo/db/record.cpp
Expand Up @@ -187,7 +187,7 @@ namespace mongo {
void Record::touch( bool entireRecrd ) const {
if ( _lengthWithHeaders > HeaderSize ) { // this also makes sure lengthWithHeaders is in memory
const char * addr = _data;
const char * end = _data + netLength();
const char * end = _data + _netLength();
for ( ; addr <= end ; addr += 2048 ) {
__record_touch_dummy += addr[0];

Expand Down

0 comments on commit 9b73925

Please sign in to comment.