Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redis 是如何通过key查找value的? #37

Open
LHRchina opened this issue Aug 27, 2017 · 1 comment
Open

redis 是如何通过key查找value的? #37

LHRchina opened this issue Aug 27, 2017 · 1 comment

Comments

@LHRchina
Copy link

redis 中的key和value都是redisObject ,但是通过key是如何找到value的呢?
typedef struct redisObject {
unsigned type:4;
unsigned encoding:4;
unsigned lru:LRU_BITS; /* lru time (relative to server.lruclock) */
int refcount;
void *ptr;
} robj;
这个结构中的 ptr 指向的应该是存储的实际值吧,但是key 是如何指向value的呢?

@yws-tracy
Copy link

image
hope this can help u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants