/*
- * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
#include "squid.h"
#include "base/TextException.h"
#include "Debug.h"
+#include "sbuf/DetailedStats.h"
#include "sbuf/MemBlob.h"
-#include "SBufDetailedStats.h"
#include <iostream>
++Stats.append;
}
+void
+MemBlob::syncSize(const size_type n)
+{
+ debugs(MEMBLOB_DEBUGSECTION, 7, n << " was: " << size);
+ Must(LockCount() <= 1);
+ Must(n <= size);
+ size = n;
+}
+
+void
+MemBlob::consume(const size_type rawN)
+{
+ if (rawN && size) {
+ Must(LockCount() <= 1);
+ const auto n = std::min(rawN, size);
+ size -= n;
+ if (size)
+ memmove(mem, mem + n, size);
+ }
+}
+
const MemBlobStats&
MemBlob::GetStats()
{