//向slab归还item void do_item_remove(item *it) { MEMCACHED_ITEM_REMOVE(ITEM_key(it), it->nkey, it->nbytes); assert((it->it_flags & ITEM_SLABBED) == 0); //引用计数为0时归还 if (refcount_decr(&it->refcount) == 0) { item_free(it); } }
void do_item_remove(item *it) { syslog(LOG_INFO, "[%s:%s:%d]", __FILE__, __func__, __LINE__); MEMCACHED_ITEM_REMOVE(ITEM_key(it), it->nkey, it->nbytes); assert((it->it_flags & ITEM_SLABBED) == 0); if (refcount_decr(&it->refcount) == 0) { item_free(it); } }
void do_item_release(struct default_engine *engine, hash_item *it) { MEMCACHED_ITEM_REMOVE(item_get_key(it), it->nkey, it->nbytes); if (it->refcount != 0) { it->refcount--; DEBUG_REFCNT(it, '-'); } if (it->refcount == 0 && (it->iflag & ITEM_LINKED) == 0) { item_free(engine, it); } }
void do_item_remove(item *it) { MEMCACHED_ITEM_REMOVE(ITEM_key(it), it->nkey, it->nbytes); assert((it->it_flags & ITEM_SLABBED) == 0); if (it->refcount != 0) { it->refcount--; DEBUG_REFCNT(it, '-'); } if (it->refcount == 0 && (it->it_flags & ITEM_LINKED) == 0) { item_free(it); } }
static void do_item_release(struct demo_engine *engine, hash_item *it) { MEMCACHED_ITEM_REMOVE(dm_item_get_key(it), it->nkey, it->nbytes); if (it->refcount != 0) { ITEM_REFCOUNT_DECR(it); DEBUG_REFCNT(it, '-'); } if (it->refcount == 0) { if ((it->iflag & ITEM_LINKED) == 0) { do_item_free(engine, it); } } }