Go to the documentation of this file.
41 void *
operator new(
size_t,
void *where) {
return where;}
46 void operator delete(
void *,
void *) {}
81 static_assert(std::is_standard_layout<cbdata>::value,
"the behavior of offsetof(cbdata) is defined");
96 static const auto htable =
new std::map<const void *, cbdata *>();
116 const auto t =
static_cast<const char *
>(p) - offsetof(
cbdata,
data);
117 return reinterpret_cast<cbdata *
>(
const_cast<char *
>(t));
136 label = (
char *)
xmalloc(strlen(name) + 20);
138 snprintf(label, strlen(name) + 20,
"cbdata %s (%d)", name, (
int) type);
165 p = (
void *)&c->
data;
173 debugs(45, 9,
"Allocating " << p);
183 void *p = (
void *)&c->
data;
187 debugs(45, 9,
"Freeing " << p);
203 c->cbdata::~cbdata();
217 debugs(45, 9, p <<
" has " << c->locks <<
" locks, not freeing");
233 debugs(45, 9, p <<
"=" << (c ? c->locks + 1 : -1));
250 debugs(45, 9, p <<
"=" << (c ? c->locks - 1 : -1));
289 void *p = (
void *) *pp;
an old-style void* callback parameter
int cbdataInternalReferenceDoneValid(void **pp, void **tp)
cbdata_type cbdataInternalAddType(cbdata_type type, const char *name, int size)
CallbackData & operator=(const CallbackData &other)
void * cbdataInternalAlloc(cbdata_type type)
struct CBDataIndex * cbdata_index
void cbdataInternalLock(const void *p)
void * alloc()
provide (and reserve) memory suitable for storing one object
static size_t dataSize(DB_ENTRY *data)
int cbdataReferenceValid(const void *p)
#define cbdataReference(var)
void * cbdataInternalFree(void *p)
static const cbdata_type CBDATA_UNKNOWN
void freeOne(void *obj)
return memory reserved by alloc()
#define memPoolCreate
Creates a named MemPool of elements with the given size.
static auto & CbdataTable()
#define cbdataReferenceDone(var)
#define CBDATA_CLASS_INIT(type)
static cbdata * FromUserData(const void *)
static void cbdataRealFree(cbdata *c)
void * xrealloc(void *s, size_t sz)
void cbdataInternalUnlock(const void *p)
#define debugs(SECTION, LEVEL, CONTENT)
void * data_
raw callback data, maybe invalid