Update LFU when an object is accessed. * Firstly, decrement the counter if the decrement time is reached. * Then logarithmically increment the counter, and update the access time. */
| 52 | * Firstly, decrement the counter if the decrement time is reached. |
| 53 | * Then logarithmically increment the counter, and update the access time. */ |
| 54 | void updateLFU(robj *val) { |
| 55 | unsigned long counter = LFUDecrAndReturn(val); |
| 56 | counter = LFULogIncr(counter); |
| 57 | val->lru = (LFUGetTimeInMinutes()<<8) | counter; |
| 58 | } |
| 59 | |
| 60 | /* Low level key lookup API, not actually called directly from commands |
| 61 | * implementations that should instead rely on lookupKeyRead(), |
no test coverage detected