Slab Dispenser : http://blog.csdn.net/luotuo44/article/details/42737181
Hash operation : http://blog.csdn.net/luotuo44/article/details/42773231
LRU operation : http://blog.csdn.net/luotuo44/article/details/42869325
configuration Parameters : http://blog.csdn.net/luotuo44/article/details/42672913
Core structural Body
typedef struct _STRITEM {struct _stritem *next; struct _stritem *prev; struct _stritem *h_next; /* Hash Chain Next */rel_time_t time; /* Least recent Access */rel_time_t exptime; /* Expire time */int nbytes; /* Size of data */unsigned short refcount; uint8_t Nsuffix; /* Length of flags-and-length String */uint8_t it_flags; /* item_* above */uint8_t slabs_clsid;/* which slab class we ' re in */uint8_t nkey; /* Key length, w/terminating null and padding */uint64_t cas_id; /* The CAS identifier */void * end[]; /* Then null-terminated key */* then "flags length\r\n" (no terminating null) */* then data with terminating \ r \ n (no terminating null; it ' s binary!) */} item;typedef struct {unsigned int size; /* Sizes of items */unsigned int perslab; /* How many items per slab */void **slots; /* List of item Ptrs */ unsigned int sl_total; /* Size of previous array */unsigned int sl_curr; /* First free slot */void *end_page_ptr; /* Pointer to next free item at end of page, or 0 */unsigned int end_page_free; /* Number of items remaining at end of the last alloced page */unsigned int slabs; /* How many slabs were allocated for this class */void **slab_list; /* Array of slab pointers */unsigned int list_size; /* Size of prev array */unsigned int killing; /* index+1 of dying slab, or zero if none */} slabclass_t;
Probe into memory management of Memcache