// it's available, we're effectively claiming ownership
// of it. If it's not, we need to go away (realloc)
if (store_->canAppend(off_+len_, minSpace)) {
- debugs(24, 7, id << "not growing");
+ debugs(24, 7, id << " not growing");
return bufEnd();
}
// TODO: we may try to memmove before realloc'ing in order to avoid
n = length();
else
n = min(n, length());
- debugs(24, 8, id << "consume " << n);
+ debugs(24, 8, id << " consume " << n);
SBuf rv(substr(0, n));
chop(n);
return rv;
void
SBuf::forceSize(size_type newSize)
{
- debugs(24, 8, id << "force " << (newSize > length() ? "grow" : "shrink") << " to length=" << newSize);
+ debugs(24, 8, id << " force " << (newSize > length() ? "grow" : "shrink") << " to length=" << newSize);
Must(store_->LockCount() == 1);
if (newSize > min(maxSize,store_->capacity-off_))
void
SBuf::reAlloc(size_type newsize)
{
- debugs(24, 8, id << "new size: " << newsize);
+ debugs(24, 8, id << " new size: " << newsize);
if (newsize > maxSize)
throw SBufTooBigException(__FILE__, __LINE__);
MemBlob::Pointer newbuf = new MemBlob(newsize);
store_ = newbuf;
off_ = 0;
++stats.cowSlow;
- debugs(24, 7, id << "new store capacity: " << store_->capacity);
+ debugs(24, 7, id << " new store capacity: " << store_->capacity);
}
SBuf&
void
SBuf::cow(SBuf::size_type newsize)
{
- debugs(24, 8, id << "new size:" << newsize);
+ debugs(24, 8, id << " new size:" << newsize);
if (newsize == npos || newsize < length())
newsize = length();
if (store_->LockCount() == 1 && newsize == length()) {
- debugs(24, 8, id << "no cow needed");
+ debugs(24, 8, id << " no cow needed");
++stats.cowFast;
return;
}