diff options
author | Eliot Horowitz <eliot@10gen.com> | 2011-06-24 16:50:15 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2011-06-24 16:50:15 -0400 |
commit | ac1018ca7fd60f37fa06a1b3b22269a3a67bc17b (patch) | |
tree | d818a2adc6c281a8d83449ac6cd2d15f53f86f9f /db/record.cpp | |
parent | 23b40a40002f94289b46ffc582a3a4ead4005df3 (diff) | |
download | mongo-ac1018ca7fd60f37fa06a1b3b22269a3a67bc17b.tar.gz |
mark when we access a Record
warning: this could be slow - but in my testing so far < .2% slowdown
Diffstat (limited to 'db/record.cpp')
-rw-r--r-- | db/record.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/db/record.cpp b/db/record.cpp index 9c4fcab7931..7e8656c71e6 100644 --- a/db/record.cpp +++ b/db/record.cpp @@ -205,5 +205,14 @@ namespace mongo { return false; return ProcessInfo::blockInMemory( data ); } + + Record* Record::accessed() { + const size_t page = (size_t)data >> 12; + const size_t region = page >> 6; + const size_t offset = page & 0x3f; + + ps::rolling.access( region , offset ); + return this; + } } |