diff --git a/base/src/nsDeque.cpp b/base/src/nsDeque.cpp index 3fb22a134fe5..4f55467900fd 100644 --- a/base/src/nsDeque.cpp +++ b/base/src/nsDeque.cpp @@ -20,6 +20,9 @@ #include "nsDeque.h" #include "nsCRT.h" +//#define _SELFTEST_DEQUE 1 +#undef _SELFTEST_DEQUE + /** * Standard constructor * @update gess4/18/98 @@ -133,9 +136,12 @@ void* nsDeque::Pop() { result=mData[mOrigin]; mData[mOrigin++]=0; //zero it out for debugging purposes. mSize--; + if(mCapacity==mOrigin) //you popped off the end, so cycle back around... + mOrigin=0; if(0==mSize) mOrigin=0; } + NS_ASSERTION(mOrigin { - nsDeque theDeque(PR_FALSE); //construct a simple one... + nsDeque theDeque(gDeallocator); //construct a simple one... - int ints[10]={100,200,300,400,500,600,700,800,900,1000}; + int ints[200]; int count=sizeof(ints)/sizeof(int); - int i=0; - for(i=0;i { - nsDeque theDeque(PR_FALSE); //construct a simple one... + nsDeque theDeque(gDeallocator); //construct a simple one... - int ints[10]={100,200,300,400,500,600,700,800,900,1000}; + int ints[200]; int count=sizeof(ints)/sizeof(int); - int i=0; - for(i=0;i