Clean up slab boundary checking.
Clean up slab boundary checking.

http://groups.google.com/group/memcached/browse_thread/thread/45b70cced2c4bd32

In items.c in memcached-1.2.8, these arrays allow indices up to but
not including LARGEST_ID:

...
static item *heads[LARGEST_ID];
static item *tails[LARGEST_ID];

So this comment (which appears twice) is confused:

   /* always true, warns: assert(it->slabs_clsid <= LARGEST_ID); */

The assert should be checking for clsid < LARGEST_ID, not <=.  And
then the warning would go away.  Or was the intent always to have 256
entries in the arrays, not 255?

Similarly, this code in items.c should be checking >=, not >, as
heads[LARGEST_ID] would be out-of-bounds:

   if (slabs_clsid > LARGEST_ID) return NULL;
   it = heads[slabs_clsid];

IMHO the confusion stems from the fact that LARGEST_ID is not itself a
valid id, as the name seems to imply.

xiaosl/memcached,angusfenying/memcached-win64,amyvmiwei/memcached,niaomingjian/memcached,zaycev/memcached,xiaosl/memcached,niaomingjian/memcached,dianerdianer/memcached,DSrcl/memcached,DigitalAce/memcached,romanticode/memcached,cloudrain21/memcached-1,owendCB/memcached,shelsonjava/memcached,memcached/memcached,jeremiahyan/memcached,rmccullagh/memcached,bpzhang/memcached,neutronsharc/memcached,daverigby/memcached,samanbarghi/memcached,memcached/memcached,Dhruva6/memcached,zbase/memcached,abhinavdangeti/memcached,leedc/memcached,neutronsharc/memcached,guikcd/memcached,Danzeer/memcached,cloudrain21/memcached,surajdharmapuram/memcached,leedc/memcached,mitliucak/memcached,jimwwalker/memcached,guikcd/memcached,tmharrisonwang/memcached,Metaswitch/memcached,cloudrain21/memcached-1,osheroff/memcached_kdtree,cloudrain21/memcached-1,samanbarghi/memcached,ZhangZhenhua/memcached,dkrotx/memcached-dd,zbase/memcached,EdwardLee03/memcached,EdwardLee03/memcached,EdwardLee03/memcached,kamyu104/memcached,Dhruva6/memcached,williamcheungthu/memcached,couchbase/memcached,elfchief/memcached,daverigby/kv_engine,Danzeer/memcached,Danzeer/memcached,tellapart/memcached,angusfenying/memcached-win64,bpzhang/memcached,13693100472/memcached,zaycev/memcached,zaycev/memcached,owendCB/memcached,DigitalAce/memcached,Metaswitch/memcached,daverigby/kv_engine,msg7086/repcached,mrkwse/memcached,rhli/memcached,msg7086/repcached,sagark/memcached-accel,rhli/memcached,gencer/memcached,neutronsharc/memcached,mrkwse/memcached,Dhruva6/memcached,DSrcl/memcached,DigitalAce/memcached,memcached/memcached,Distrotech/memcached,ClearwaterCore/memcached,mrkwse/memcached,dormando/memcached,gencer/memcached,tmharrisonwang/memcached,xiaosl/memcached,abhinavdangeti/memcached,romanticode/memcached,mrkwse/memcached,myPublicGit/memcached,abhinavdangeti/memcached,rhli/memcached,cloudrain21/memcached,sagark/memcached-accel,williamcheungthu/memcached,jbergstroem/memcached,niaomingjian/memcached,shelsonjava/memcached,dormando/memcached,mdounin/memcached,zbase/memcached,shelsonjava/memcached,amyvmiwei/memcached,kamyu104/memcached,tellapart/memcached,daverigby/memcached,daverigby/memcached,jeremiahyan/memcached,13693100472/memcached,sagark/memcached-accel,fengshao0907/memcached,leverich/memcached-affinity,dkrotx/memcached-dd,cloudrain21/memcached,dormando/memcached,memcached/memcached,alexandermerritt/memcached,niaomingjian/memcached,samanbarghi/memcached,elfchief/memcached,13693100472/memcached,mitliucak/memcached,daverigby/kv_engine,mitliucak/memcached,emcconville/memcached,ZhangZhenhua/memcached,zbase/memcached,allen8807/memcached-1,osheroff/memcached_kdtree,bpzhang/memcached,bpzhang/memcached,williamcheungthu/memcached,gencer/memcached,emcconville/memcached,leverich/memcached-affinity,13693100472/memcached,tomykaira/memcached,guikcd/memcached,couchbase/memcached,zbase/memcached,fengshao0907/memcached,abhinavdangeti/memcached,Dhruva6/memcached,dustin/memcached,memcached/memcached,owendCB/memcached,samt42/memcached,ClearwaterCore/memcached,jimwwalker/memcached,surajdharmapuram/memcached,shelsonjava/memcached,tmharrisonwang/memcached,jimwwalker/memcached,jeremiahyan/memcached,daverigby/kv_engine,kamyu104/memcached,Metaswitch/memcached,alexandermerritt/memcached,kamyu104/memcached,Metaswitch/memcached,samt42/memcached,elfchief/memcached,abhinavdangeti/memcached,elfchief/memcached,Danzeer/memcached,DSrcl/memcached,dormando/memcached,leverich/memcached-affinity,fengshao0907/memcached,msg7086/repcached,rmccullagh/memcached,elfchief/memcached,allen8807/memcached-1,neutronsharc/memcached,dianerdianer/memcached,ClearwaterCore/memcached,cloudrain21/memcached,mitliucak/memcached,allen8807/memcached-1,EdwardLee03/memcached,daverigby/memcached,angusfenying/memcached-win64,couchbase/memcached,jeremiahyan/memcached,dkrotx/memcached-dd,alexandermerritt/memcached,myPublicGit/memcached,tomykaira/memcached,13693100472/memcached,surajdharmapuram/memcached,leedc/memcached,osheroff/memcached_kdtree,tomykaira/memcached,jbergstroem/memcached,msg7086/repcached,emcconville/memcached,sagark/memcached-accel,msg7086/repcached,dkrotx/memcached-dd,mdounin/memcached,samt42/memcached,rmccullagh/memcached,angusfenying/memcached-win64,samanbarghi/memcached,amyvmiwei/memcached,sagark/memcached-accel,tomykaira/memcached,dormando/memcached,ClearwaterCore/memcached,Distrotech/memcached,romanticode/memcached,dustin/memcached,Distrotech/memcached,emcconville/memcached,samt42/memcached,amyvmiwei/memcached,zaycev/memcached,DSrcl/memcached,dianerdianer/memcached,xiaosl/memcached,leedc/memcached,tellapart/memcached,myPublicGit/memcached,myPublicGit/memcached,rmccullagh/memcached,dustin/memcached,rmccullagh/memcached,rhli/memcached,guikcd/memcached,cloudrain21/memcached-1,tmharrisonwang/memcached,jbergstroem/memcached,ZhangZhenhua/memcached,williamcheungthu/memcached,owendCB/memcached,gencer/memcached,mdounin/memcached,gencer/memcached,allen8807/memcached-1,romanticode/memcached,dianerdianer/memcached,ZhangZhenhua/memcached,couchbase/memcached,guikcd/memcached,surajdharmapuram/memcached,Metaswitch/memcached,fengshao0907/memcached,alexandermerritt/memcached