if (inElemCapacity > kStackBufferNumElems) { DeleteBuffer(); mBufferPtr = (T*)nsMemory::Alloc(inElemCapacity * sizeof(T)); mCurElemCapacity = inElemCapacity; return (mBufferPtr != NULL); }  mCurElemCapacity = kStackBufferNumElems;
T* newBuffer;  if (mBufferPtr != mStackBuffer) newBuffer = (T*)nsMemory::Realloc((void *)mBufferPtr, inElemCapacity * sizeof(T)); else newBuffer = (T*)nsMemory::Alloc(inElemCapacity * sizeof(T));  if (!newBuffer) return PR_FALSE;  if (mBufferPtr != mStackBuffer) nsMemory::Free(mBufferPtr);  mBufferPtr = newBuffer; mCurElemCapacity = inElemCapacity;
  PRBool EnsureElemCapacity(PRInt32 inElemCapacity)  {    if (inElemCapacity <= mCurElemCapacity)      return PR_TRUE;        if (inElemCapacity > kStackBufferNumElems)    {      DeleteBuffer();      mBufferPtr = (T*)nsMemory::Alloc(inElemCapacity * sizeof(T));      mCurElemCapacity = inElemCapacity;      return (mBufferPtr != NULL);    }        mCurElemCapacity = kStackBufferNumElems;    return PR_TRUE;  }