Given an object last access time, compute the minimum number of minutes * that elapsed since the last access. Handle overflow (ldt greater than * the current 16 bits minutes time) considering the time as wrapping * exactly once. */
| 288 | * the current 16 bits minutes time) considering the time as wrapping |
| 289 | * exactly once. */ |
| 290 | unsigned long LFUTimeElapsed(unsigned long ldt) { |
| 291 | unsigned long now = LFUGetTimeInMinutes(); |
| 292 | if (now >= ldt) return now-ldt; |
| 293 | return 65535-ldt+now; |
| 294 | } |
| 295 | |
| 296 | /* Logarithmically increment a counter. The greater is the current counter value |
| 297 | * the less likely is that it gets really implemented. Saturate it at 255. */ |
no test coverage detected