MCPcopy Create free account
hub / github.com/F-Stack/f-stack / LFUTimeElapsed

Function LFUTimeElapsed

app/redis-6.2.6/src/evict.c:290–294  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

288 * the current 16 bits minutes time) considering the time as wrapping
289 * exactly once. */
290unsigned 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. */

Callers 1

LFUDecrAndReturnFunction · 0.85

Calls 1

LFUGetTimeInMinutesFunction · 0.85

Tested by

no test coverage detected