void
SBuf::reserveCapacity(size_type minCapacity)
{
- Must(0 <= minCapacity && minCapacity <= maxSize);
- reserveSpace(minCapacity-length());
+ Must(0 <= minCapacity); //upper bound checked in cow -> reAlloc
+ cow(minCapacity);
}
void
SBuf::reserveSpace(size_type minSpace)
{
- Must(0 <= minSpace && minSpace <= maxSize);
+ Must(0 <= minSpace); //upper bound checked in cow -> reAlloc
debugs(24, 7, "reserving " << minSpace << " for " << id);
// we're not concerned about RefCounts here,
// the store knows the last-used portion. If
*
* After this method is called, the SBuf is guaranteed to have at least
* minCapacity bytes of total buffer size, including the currently-used
- * portion
+ * portion; it is also guaranteed that after this call this SBuf
+ * has unique ownership of the underlying memory store.
* \throw SBufTooBigException if the user tries to allocate too big a SBuf
*/
void reserveCapacity(size_type minCapacity);