/*
return the name of a talloc ptr, or "UNNAMED"
*/
-_PUBLIC_ const char *talloc_get_name(const void *ptr)
+static inline const char *__talloc_get_name(const void *ptr)
{
struct talloc_chunk *tc = talloc_chunk_from_ptr(ptr);
if (unlikely(tc->name == TALLOC_MAGIC_REFERENCE)) {
return "UNNAMED";
}
+_PUBLIC_ const char *talloc_get_name(const void *ptr)
+{
+ return __talloc_get_name(ptr);
+}
/*
check if a pointer has the given name. If it does, return the pointer,
{
const char *pname;
if (unlikely(ptr == NULL)) return NULL;
- pname = talloc_get_name(ptr);
+ pname = __talloc_get_name(ptr);
if (likely(pname == name || strcmp(pname, name) == 0)) {
return discard_const_p(void, ptr);
}
return NULL;
}
- pname = talloc_get_name(ptr);
+ pname = __talloc_get_name(ptr);
if (likely(pname == name || strcmp(pname, name) == 0)) {
return discard_const_p(void, ptr);
}
static void talloc_report_depth_FILE_helper(const void *ptr, int depth, int max_depth, int is_ref, void *_f)
{
- const char *name = talloc_get_name(ptr);
+ const char *name = __talloc_get_name(ptr);
struct talloc_chunk *tc;
FILE *f = (FILE *)_f;
}
tc = talloc_chunk_from_ptr(context);
- fprintf(file, "talloc parents of '%s'\n", talloc_get_name(context));
+ fprintf(file, "talloc parents of '%s'\n", __talloc_get_name(context));
while (tc) {
- fprintf(file, "\t'%s'\n", talloc_get_name(TC_PTR_FROM_CHUNK(tc)));
+ fprintf(file, "\t'%s'\n", __talloc_get_name(TC_PTR_FROM_CHUNK(tc)));
while (tc && tc->prev) tc = tc->prev;
if (tc) {
tc = tc->parent;