Go to the documentation of this file.
36 "MemBlob created: " <<
alloc <<
37 "\nMemBlob alive: " <<
live <<
38 "\nMemBlob append calls: " <<
append <<
39 "\nMemBlob currently allocated size: " <<
liveBytes <<
40 "\nlive MemBlob mean current allocation size: " <<
61 mem(nullptr), capacity(0),
size(0)
64 <<
static_cast<void*
>(
this) <<
" id=" <<
id
65 <<
" reserveSize=" << reserveSize);
70 mem(nullptr), capacity(0),
size(0)
73 <<
static_cast<void*
>(
this) <<
" id=" <<
id
74 <<
" buffer=" <<
static_cast<const void*
>(buffer)
75 <<
" bufSize=" << bufSize);
90 <<
static_cast<void*
>(
this) <<
" id=" <<
id
101 size_t actualAlloc = minSize;
110 id <<
" memAlloc: requested=" << minSize <<
132 memmove(
mem +
size, source, n);
142 Must(LockCount() <= 1);
151 Must(LockCount() <= 1);
162 os <<
"id @" << (
void *)
this
163 <<
"mem:" <<
static_cast<void*
>(
mem)
166 <<
",refs:" << LockCount() <<
"; ";
#define MEMBLOB_DEBUGSECTION
void syncSize(const size_type n)
bool willFit(const size_type n) const
whether n more bytes can be appended
static auto & WriteableStats()
void * memAllocBuf(size_t net_size, size_t *gross_size)
size_type size
maximum allocated memory in use by callers
uint64_t append
number of MemBlob::append() calls
MemBlob(const size_type reserveSize)
create a new MemBlob with at least reserveSize capacity
uint64_t alloc
number of MemBlob instances created so far
std::ostream & dump(std::ostream &os) const
dumps class-wide statistics
InstanceIdDefinitions(MemBlob, "blob")
static const MemBlobStats & GetStats()
obtain a const view of class-wide statistics
void appended(const size_type n)
uint64_t live
number of MemBlob instances currently alive
uint64_t liveBytes
the total size of currently allocated storage
MemBlobStats & operator+=(const MemBlobStats &)
size_type capacity
size of the raw allocated memory block
static void RecordMemBlobSizeAtDestruct(size_t)
Record the size a MemBlob had when it was destructed.
std::ostream & dump(std::ostream &os) const
dump debugging information
Various MemBlob class-wide statistics.
void append(const char *source, const size_type n)
void consume(const size_type n)
char * mem
raw allocated memory block
#define debugs(SECTION, LEVEL, CONTENT)
const A & min(A const &lhs, A const &rhs)
void memAlloc(const size_type memSize)
void memFreeBuf(size_t size, void *)