void
SBuf::reserveCapacity(size_type minCapacity)
{
- Must(0 <= minCapacity); //upper bound checked in cow -> reAlloc
+ Must(0 <= minCapacity);
+ Must(minCapacity <= maxSize);
cow(minCapacity);
}
char *
SBuf::rawSpace(size_type minSpace)
{
- Must(0 <= minSpace); //upper bound checked in cow -> reAlloc
+ Must(0 <= minSpace);
+ Must(minSpace <= maxSize);
debugs(24, 7, "reserving " << minSpace << " for " << id);
++stats.rawAccess;
// we're not concerned about RefCounts here,
* used portion and single ownership of the backing store.
* \throw SBufTooBigException if the user tries to allocate too big a SBuf
*/
- void reserveSpace(size_type minSpace) {reserveCapacity(length()+minSpace);}
+ void reserveSpace(size_type minSpace) {
+ Must(0 <= minSpace);
+ Must(minSpace <= maxSize);
+ reserveCapacity(length()+minSpace);
+ }
/** Request to guarantee the SBuf's store capacity
*