happyfish100 / libshmcache

libshmcache is a local cache in the share memory for multi processes. high performance due to read is lockless. libshmcache is 100+ times faster than a remote interface such as redis.
449 stars 136 forks source link

代码问题 #24

Open cestlascorpion opened 5 years ago

cestlascorpion commented 5 years ago

在 shm_object_pool.c 的 shm_object_pool_remove() 函数中,如果出现了op->index != op->obj_pool_info->queue.head,在while循环过程中,原本待移除的obj_offset值会被覆盖。在循环开始前只保留了该offset值所处的索引,即op->index,实际上应该保存op->offsets[op->index]再进入循环。 不过我暂时没有测试到不等的情况,也许理解上出现了偏差,请多指教。