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. */
| 299 | * the current 16 bits minutes time) considering the time as wrapping |
| 300 | * exactly once. */ |
| 301 | unsigned long LFUTimeElapsed(unsigned long ldt) { |
| 302 | unsigned long now = LFUGetTimeInMinutes(); |
| 303 | if (now >= ldt) return now-ldt; |
| 304 | return 65535-ldt+now; |
| 305 | } |
| 306 | |
| 307 | /* Logarithmically increment a counter. The greater is the current counter value |
| 308 | * the less likely is that it gets really implemented. Saturate it at 255. */ |
no test coverage detected