示例#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
文件: zmalloc.c 项目: atomx/discnt
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
文件: zmalloc.c 项目: hylaz/redis
size_t zmalloc_used_memory(void) {
    size_t um;
    atomicGet(used_memory,um);
    return um;
}