This function is used to obtain the current LRU clock. * If the current resolution is lower than the frequency we refresh the * LRU clock (as it should be in production servers) we return the * precomputed value, otherwise we need to resort to a system call. */
| 79 | * LRU clock (as it should be in production servers) we return the |
| 80 | * precomputed value, otherwise we need to resort to a system call. */ |
| 81 | unsigned int LRU_CLOCK(void) { |
| 82 | unsigned int lruclock; |
| 83 | if (1000/g_pserver->hz <= LRU_CLOCK_RESOLUTION) { |
| 84 | lruclock = g_pserver->lruclock; |
| 85 | } else { |
| 86 | lruclock = getLRUClock(); |
| 87 | } |
| 88 | return lruclock; |
| 89 | } |
| 90 | |
| 91 | /* Given an object returns the min number of milliseconds the object was never |
| 92 | * requested, using an approximated LRU algorithm. */ |
no test coverage detected