Пример #1
0
/* 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. */
unsigned int LRU_CLOCK(void) {
    unsigned int lruclock;
    if (1000/server.hz <= LRU_CLOCK_RESOLUTION) {
        atomicGet(server.lruclock,lruclock);
    } else {
        lruclock = getLRUClock();
    }
    return lruclock;
}
Пример #2
0
size_t zmalloc_used_memory(void) {
    size_t um;

    if (zmalloc_thread_safe) {
        atomicGet(used_memory,um,&used_memory_mutex);
    } else {
        um = used_memory;
    }
    return um;
}
Пример #3
0
size_t zmalloc_used_memory(void) {
    size_t um;
    atomicGet(used_memory,um);
    return um;
}