NetSurf
Data Structures | Macros | Typedefs | Functions | Variables
talloc.c File Reference
#include <stdarg.h>
#include "talloc.h"
Include dependency graph for talloc.c:

Go to the source code of this file.

Data Structures

struct  talloc_reference_handle
 
struct  talloc_chunk
 

Macros

#define STANDALONE
 
#define ALWAYS_REALLOC   0
 
#define MAX_TALLOC_SIZE   0x10000000
 
#define TALLOC_MAGIC   0xe814ec70
 
#define TALLOC_FLAG_FREE   0x01
 
#define TALLOC_FLAG_LOOP   0x02
 
#define TALLOC_MAGIC_REFERENCE   ((const char *)1)
 
#define TALLOC_ABORT(reason)   abort()
 
#define discard_const_p(type, ptr)   ((type *)(ptr))
 
#define likely(x)   x
 
#define unlikely(x)   x
 
#define TC_HDR_SIZE   ((sizeof(struct talloc_chunk)+15)&~15)
 
#define TC_PTR_FROM_CHUNK(tc)   ((void *)(TC_HDR_SIZE + (char*)tc))
 
#define _TLIST_ADD(list, p)
 
#define _TLIST_REMOVE(list, p)
 
#define va_copy(dest, src)   (dest) = (src)
 

Typedefs

typedef int(* talloc_destructor_t) (void *)
 

Functions

static struct talloc_chunktalloc_chunk_from_ptr (const void *ptr)
 
static struct talloc_chunktalloc_parent_chunk (const void *ptr)
 
void * talloc_parent (const void *ptr)
 
const char * talloc_parent_name (const void *ptr)
 
static void * __talloc (const void *context, size_t size)
 
void _talloc_set_destructor (const void *ptr, int(*destructor)(void *))
 
int talloc_increase_ref_count (const void *ptr)
 
static int talloc_reference_destructor (struct talloc_reference_handle *handle)
 
static void _talloc_set_name_const (const void *ptr, const char *name)
 
static void * _talloc_named_const (const void *context, size_t size, const char *name)
 
void * _talloc_reference (const void *context, const void *ptr)
 
static int _talloc_free (void *ptr)
 
void * _talloc_steal (const void *new_ctx, const void *ptr)
 
static int talloc_unreference (const void *context, const void *ptr)
 
int talloc_unlink (const void *context, void *ptr)
 
static const char * talloc_set_name_v (const void *ptr, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2
 
const char * talloc_set_name (const void *ptr, const char *fmt,...)
 
void * talloc_named (const void *context, size_t size, const char *fmt,...)
 
const char * talloc_get_name (const void *ptr)
 
void * talloc_check_name (const void *ptr, const char *name)
 
void * talloc_init (const char *fmt,...)
 
void talloc_free_children (void *ptr)
 
void * _talloc (const void *context, size_t size)
 
void talloc_set_name_const (const void *ptr, const char *name)
 
void * talloc_named_const (const void *context, size_t size, const char *name)
 
int talloc_free (void *ptr)
 
void * _talloc_realloc (const void *context, void *ptr, size_t size, const char *name)
 
void * _talloc_move (const void *new_ctx, const void *_pptr)
 
size_t talloc_total_size (const void *ptr)
 
size_t talloc_total_blocks (const void *ptr)
 
size_t talloc_reference_count (const void *ptr)
 
void talloc_report_depth_cb (const void *ptr, int depth, int max_depth, void(*callback)(const void *ptr, int depth, int max_depth, int is_ref, void *private_data), void *private_data)
 
static void talloc_report_depth_FILE_helper (const void *ptr, int depth, int max_depth, int is_ref, void *_f)
 
void talloc_report_depth_file (const void *ptr, int depth, int max_depth, FILE *f)
 
void talloc_report_full (const void *ptr, FILE *f)
 
void talloc_report (const void *ptr, FILE *f)
 
static void talloc_report_null (void)
 
static void talloc_report_null_full (void)
 
void talloc_enable_null_tracking (void)
 
void talloc_disable_null_tracking (void)
 
void talloc_enable_leak_report (void)
 
void talloc_enable_leak_report_full (void)
 
void * _talloc_zero (const void *ctx, size_t size, const char *name)
 
void * _talloc_memdup (const void *t, const void *p, size_t size, const char *name)
 
char * talloc_strdup (const void *t, const char *p)
 
char * talloc_append_string (const void *t, char *orig, const char *append)
 
char * talloc_strndup (const void *t, const char *p, size_t n)
 
char * talloc_vasprintf (const void *t, const char *fmt, va_list ap)
 
char * talloc_asprintf (const void *t, const char *fmt,...)
 
char * talloc_vasprintf_append (char *s, const char *fmt, va_list ap)
 Realloc s to append the formatted result of fmt and ap, and return s, which may have moved. More...
 
char * talloc_asprintf_append (char *s, const char *fmt,...)
 
void * _talloc_array (const void *ctx, size_t el_size, unsigned count, const char *name)
 
void * _talloc_zero_array (const void *ctx, size_t el_size, unsigned count, const char *name)
 
void * _talloc_realloc_array (const void *ctx, void *ptr, size_t el_size, unsigned count, const char *name)
 
void * talloc_realloc_fn (const void *context, void *ptr, size_t size)
 
static int talloc_autofree_destructor (void *ptr)
 
static void talloc_autofree (void)
 
void * talloc_autofree_context (void)
 
size_t talloc_get_size (const void *context)
 
void * talloc_find_parent_byname (const void *context, const char *name)
 
void talloc_show_parents (const void *context, FILE *file)
 
int talloc_is_parent (const void *context, const void *ptr)
 

Variables

static void * null_context
 
static void * autofree_context
 

Macro Definition Documentation

◆ _TLIST_ADD

#define _TLIST_ADD (   list,
 
)
Value:
do { \
if (!(list)) { \
(list) = (p); \
(p)->next = (p)->prev = NULL; \
} else { \
(list)->prev = (p); \
(p)->next = (list); \
(p)->prev = NULL; \
(list) = (p); \
}\
} while (0)

Definition at line 147 of file talloc.c.

◆ _TLIST_REMOVE

#define _TLIST_REMOVE (   list,
 
)
Value:
do { \
if ((p) == (list)) { \
(list) = (p)->next; \
if (list) (list)->prev = NULL; \
} else { \
if ((p)->prev) (p)->prev->next = (p)->next; \
if ((p)->next) (p)->next->prev = (p)->prev; \
} \
if ((p) && ((p) != (list))) (p)->next = (p)->prev = NULL; \
} while (0)

Definition at line 161 of file talloc.c.

◆ ALWAYS_REALLOC

#define ALWAYS_REALLOC   0

Definition at line 69 of file talloc.c.

◆ discard_const_p

#define discard_const_p (   type,
  ptr 
)    ((type *)(ptr))

Definition at line 88 of file talloc.c.

◆ likely

#define likely (   x)    x

Definition at line 99 of file talloc.c.

◆ MAX_TALLOC_SIZE

#define MAX_TALLOC_SIZE   0x10000000

Definition at line 72 of file talloc.c.

◆ STANDALONE

#define STANDALONE

Definition at line 51 of file talloc.c.

◆ TALLOC_ABORT

#define TALLOC_ABORT (   reason)    abort()

Definition at line 81 of file talloc.c.

◆ TALLOC_FLAG_FREE

#define TALLOC_FLAG_FREE   0x01

Definition at line 74 of file talloc.c.

◆ TALLOC_FLAG_LOOP

#define TALLOC_FLAG_LOOP   0x02

Definition at line 75 of file talloc.c.

◆ TALLOC_MAGIC

#define TALLOC_MAGIC   0xe814ec70

Definition at line 73 of file talloc.c.

◆ TALLOC_MAGIC_REFERENCE

#define TALLOC_MAGIC_REFERENCE   ((const char *)1)

Definition at line 76 of file talloc.c.

◆ TC_HDR_SIZE

#define TC_HDR_SIZE   ((sizeof(struct talloc_chunk)+15)&~15)

Definition at line 128 of file talloc.c.

◆ TC_PTR_FROM_CHUNK

#define TC_PTR_FROM_CHUNK (   tc)    ((void *)(TC_HDR_SIZE + (char*)tc))

Definition at line 129 of file talloc.c.

◆ unlikely

#define unlikely (   x)    x

Definition at line 100 of file talloc.c.

◆ va_copy

#define va_copy (   dest,
  src 
)    (dest) = (src)

Definition at line 1179 of file talloc.c.

Typedef Documentation

◆ talloc_destructor_t

typedef int(* talloc_destructor_t) (void *)

Definition at line 115 of file talloc.c.

Function Documentation

◆ __talloc()

static void * __talloc ( const void *  context,
size_t  size 
)
inlinestatic

Definition at line 209 of file talloc.c.

References talloc_chunk::child, talloc_chunk::destructor, talloc_chunk::flags, likely, MAX_TALLOC_SIZE, talloc_chunk::name, talloc_chunk::next, null_context, parent, talloc_chunk::parent, talloc_chunk::prev, talloc_chunk::refs, talloc_chunk::size, talloc_chunk_from_ptr(), TALLOC_MAGIC, TC_HDR_SIZE, TC_PTR_FROM_CHUNK, and unlikely.

Referenced by _talloc(), _talloc_named_const(), talloc_init(), talloc_named(), talloc_strndup(), and talloc_vasprintf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _talloc()

void * _talloc ( const void *  context,
size_t  size 
)

Definition at line 729 of file talloc.c.

References __talloc(), and talloc_chunk::size.

Here is the call graph for this function:

◆ _talloc_array()

void * _talloc_array ( const void *  ctx,
size_t  el_size,
unsigned  count,
const char *  name 
)

Definition at line 1289 of file talloc.c.

References _talloc_named_const(), count(), MAX_TALLOC_SIZE, and talloc_chunk::name.

Here is the call graph for this function:

◆ _talloc_free()

static int _talloc_free ( void *  ptr)
inlinestatic

Definition at line 347 of file talloc.c.

References _talloc_free(), _TLIST_REMOVE, talloc_chunk::child, talloc_chunk::destructor, talloc_chunk::flags, talloc_chunk::next, null_context, talloc_chunk::parent, talloc_chunk::prev, talloc_chunk::refs, talloc_chunk_from_ptr(), TALLOC_FLAG_FREE, TALLOC_FLAG_LOOP, talloc_is_parent(), talloc_parent_chunk(), talloc_steal, TC_PTR_FROM_CHUNK, and unlikely.

Referenced by _talloc_free(), _talloc_realloc(), talloc_autofree(), talloc_disable_null_tracking(), talloc_free(), talloc_free_children(), talloc_init(), talloc_named(), talloc_unlink(), and talloc_unreference().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _talloc_memdup()

void * _talloc_memdup ( const void *  t,
const void *  p,
size_t  size,
const char *  name 
)

Definition at line 1104 of file talloc.c.

References _talloc_named_const(), and likely.

Here is the call graph for this function:

◆ _talloc_move()

void * _talloc_move ( const void *  new_ctx,
const void *  _pptr 
)

Definition at line 841 of file talloc.c.

References _talloc_steal(), and discard_const_p.

Here is the call graph for this function:

◆ _talloc_named_const()

static void * _talloc_named_const ( const void *  context,
size_t  size,
const char *  name 
)
inlinestatic

Definition at line 299 of file talloc.c.

References __talloc(), _talloc_set_name_const(), talloc_chunk::name, talloc_chunk::size, and unlikely.

Referenced by _talloc_array(), _talloc_memdup(), _talloc_realloc(), _talloc_reference(), _talloc_zero(), talloc_autofree_context(), talloc_enable_null_tracking(), and talloc_named_const().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _talloc_realloc()

void * _talloc_realloc ( const void *  context,
void *  ptr,
size_t  size,
const char *  name 
)

Definition at line 771 of file talloc.c.

References _talloc_free(), _talloc_named_const(), _talloc_set_name_const(), talloc_chunk::child, talloc_chunk::flags, MAX_TALLOC_SIZE, talloc_chunk::name, talloc_chunk::next, talloc_chunk::parent, talloc_chunk::prev, talloc_chunk::refs, talloc_chunk::size, talloc_chunk_from_ptr(), TALLOC_FLAG_FREE, TC_HDR_SIZE, TC_PTR_FROM_CHUNK, and unlikely.

Referenced by _talloc_realloc_array(), and talloc_realloc_fn().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _talloc_realloc_array()

void * _talloc_realloc_array ( const void *  ctx,
void *  ptr,
size_t  el_size,
unsigned  count,
const char *  name 
)

Definition at line 1311 of file talloc.c.

References _talloc_realloc(), count(), MAX_TALLOC_SIZE, and talloc_chunk::name.

Here is the call graph for this function:

◆ _talloc_reference()

void * _talloc_reference ( const void *  context,
const void *  ptr 
)

Definition at line 322 of file talloc.c.

References _talloc_named_const(), _TLIST_ADD, discard_const_p, talloc_reference_handle::ptr, talloc_chunk::refs, talloc_chunk_from_ptr(), TALLOC_MAGIC_REFERENCE, talloc_reference_destructor(), talloc_set_destructor, and unlikely.

Here is the call graph for this function:

◆ _talloc_set_destructor()

void _talloc_set_destructor ( const void *  ptr,
int(*)(void *)  destructor 
)

Definition at line 257 of file talloc.c.

References talloc_chunk::destructor, and talloc_chunk_from_ptr().

Here is the call graph for this function:

◆ _talloc_set_name_const()

static void _talloc_set_name_const ( const void *  ptr,
const char *  name 
)
inlinestatic

Definition at line 290 of file talloc.c.

References talloc_chunk::name, and talloc_chunk_from_ptr().

Referenced by _talloc_named_const(), _talloc_realloc(), talloc_append_string(), talloc_set_name_const(), talloc_set_name_v(), talloc_strdup(), talloc_strndup(), talloc_vasprintf(), and talloc_vasprintf_append().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _talloc_steal()

void * _talloc_steal ( const void *  new_ctx,
const void *  ptr 
)

Definition at line 435 of file talloc.c.

References _TLIST_ADD, _TLIST_REMOVE, talloc_chunk::child, discard_const_p, talloc_chunk::next, null_context, talloc_chunk::parent, talloc_chunk::prev, talloc_chunk_from_ptr(), and unlikely.

Referenced by _talloc_move().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _talloc_zero()

void * _talloc_zero ( const void *  ctx,
size_t  size,
const char *  name 
)

Definition at line 1090 of file talloc.c.

References _talloc_named_const().

Referenced by _talloc_zero_array().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _talloc_zero_array()

void * _talloc_zero_array ( const void *  ctx,
size_t  el_size,
unsigned  count,
const char *  name 
)

Definition at line 1300 of file talloc.c.

References _talloc_zero(), count(), MAX_TALLOC_SIZE, and talloc_chunk::name.

Here is the call graph for this function:

◆ talloc_append_string()

char * talloc_append_string ( const void *  t,
char *  orig,
const char *  append 
)

Definition at line 1134 of file talloc.c.

References _talloc_set_name_const(), and talloc_realloc.

Here is the call graph for this function:

◆ talloc_asprintf()

char * talloc_asprintf ( const void *  t,
const char *  fmt,
  ... 
)

Definition at line 1214 of file talloc.c.

References talloc_vasprintf().

Here is the call graph for this function:

◆ talloc_asprintf_append()

char * talloc_asprintf_append ( char *  s,
const char *  fmt,
  ... 
)

Definition at line 1276 of file talloc.c.

References talloc_vasprintf_append().

Here is the call graph for this function:

◆ talloc_autofree()

static void talloc_autofree ( void  )
static

Definition at line 1336 of file talloc.c.

References _talloc_free(), and autofree_context.

Referenced by talloc_autofree_context().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talloc_autofree_context()

void * talloc_autofree_context ( void  )

Definition at line 1345 of file talloc.c.

References _talloc_named_const(), autofree_context, talloc_autofree(), talloc_autofree_destructor(), and talloc_set_destructor.

Here is the call graph for this function:

◆ talloc_autofree_destructor()

static int talloc_autofree_destructor ( void *  ptr)
static

Definition at line 1330 of file talloc.c.

References autofree_context.

Referenced by talloc_autofree_context().

Here is the caller graph for this function:

◆ talloc_check_name()

void * talloc_check_name ( const void *  ptr,
const char *  name 
)

Definition at line 646 of file talloc.c.

References discard_const_p, likely, talloc_chunk::name, talloc_get_name(), and unlikely.

Here is the call graph for this function:

◆ talloc_chunk_from_ptr()

static struct talloc_chunk * talloc_chunk_from_ptr ( const void *  ptr)
inlinestatic

◆ talloc_disable_null_tracking()

void talloc_disable_null_tracking ( void  )

Definition at line 1063 of file talloc.c.

References _talloc_free(), and null_context.

Here is the call graph for this function:

◆ talloc_enable_leak_report()

void talloc_enable_leak_report ( void  )

Definition at line 1072 of file talloc.c.

References talloc_enable_null_tracking(), and talloc_report_null().

Here is the call graph for this function:

◆ talloc_enable_leak_report_full()

void talloc_enable_leak_report_full ( void  )

Definition at line 1081 of file talloc.c.

References talloc_enable_null_tracking(), and talloc_report_null_full().

Here is the call graph for this function:

◆ talloc_enable_null_tracking()

void talloc_enable_null_tracking ( void  )

Definition at line 1053 of file talloc.c.

References _talloc_named_const(), and null_context.

Referenced by talloc_enable_leak_report(), talloc_enable_leak_report_full(), and talloc_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talloc_find_parent_byname()

void * talloc_find_parent_byname ( const void *  context,
const char *  name 
)

Definition at line 1370 of file talloc.c.

References talloc_chunk::name, talloc_chunk::parent, talloc_chunk::prev, talloc_chunk_from_ptr(), and TC_PTR_FROM_CHUNK.

Here is the call graph for this function:

◆ talloc_free()

int talloc_free ( void *  ptr)

Definition at line 760 of file talloc.c.

References _talloc_free().

Referenced by box_free_box(), form__select_process_selection(), html_destroy(), html_destroy_frameset(), html_destroy_iframe(), and html_free_layout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talloc_free_children()

void talloc_free_children ( void *  ptr)

Definition at line 694 of file talloc.c.

References _talloc_free(), talloc_chunk::child, null_context, talloc_chunk::refs, talloc_chunk_from_ptr(), talloc_parent_chunk(), talloc_steal, TC_PTR_FROM_CHUNK, and unlikely.

Here is the call graph for this function:

◆ talloc_get_name()

const char * talloc_get_name ( const void *  ptr)

Definition at line 629 of file talloc.c.

References likely, talloc_chunk::name, talloc_chunk_from_ptr(), TALLOC_MAGIC_REFERENCE, and unlikely.

Referenced by talloc_check_name(), talloc_report_depth_FILE_helper(), and talloc_show_parents().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talloc_get_size()

size_t talloc_get_size ( const void *  context)

Definition at line 1355 of file talloc.c.

References talloc_chunk::size, and talloc_chunk_from_ptr().

Here is the call graph for this function:

◆ talloc_increase_ref_count()

int talloc_increase_ref_count ( const void *  ptr)

Definition at line 266 of file talloc.c.

References null_context, talloc_reference, and unlikely.

◆ talloc_init()

void * talloc_init ( const char *  fmt,
  ... 
)

Definition at line 661 of file talloc.c.

References __talloc(), _talloc_free(), talloc_chunk::name, talloc_enable_null_tracking(), talloc_set_name_v(), and unlikely.

Here is the call graph for this function:

◆ talloc_is_parent()

int talloc_is_parent ( const void *  context,
const void *  ptr 
)

Definition at line 1418 of file talloc.c.

References talloc_chunk::parent, talloc_chunk::prev, talloc_chunk_from_ptr(), and TC_PTR_FROM_CHUNK.

Referenced by _talloc_free().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talloc_named()

void * talloc_named ( const void *  context,
size_t  size,
const char *  fmt,
  ... 
)

Definition at line 605 of file talloc.c.

References __talloc(), _talloc_free(), talloc_chunk::name, talloc_chunk::size, talloc_set_name_v(), and unlikely.

Here is the call graph for this function:

◆ talloc_named_const()

void * talloc_named_const ( const void *  context,
size_t  size,
const char *  name 
)

Definition at line 747 of file talloc.c.

References _talloc_named_const(), talloc_chunk::name, and talloc_chunk::size.

Here is the call graph for this function:

◆ talloc_parent()

void * talloc_parent ( const void *  ptr)

Definition at line 191 of file talloc.c.

References talloc_parent_chunk(), and TC_PTR_FROM_CHUNK.

Here is the call graph for this function:

◆ talloc_parent_chunk()

static struct talloc_chunk * talloc_parent_chunk ( const void *  ptr)
inlinestatic

Definition at line 177 of file talloc.c.

References talloc_chunk::parent, talloc_chunk::prev, talloc_chunk_from_ptr(), and unlikely.

Referenced by _talloc_free(), talloc_free_children(), talloc_parent(), talloc_parent_name(), talloc_unlink(), and talloc_unreference().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talloc_parent_name()

const char * talloc_parent_name ( const void *  ptr)

Definition at line 200 of file talloc.c.

References talloc_chunk::name, and talloc_parent_chunk().

Here is the call graph for this function:

◆ talloc_realloc_fn()

void * talloc_realloc_fn ( const void *  context,
void *  ptr,
size_t  size 
)

Definition at line 1324 of file talloc.c.

References _talloc_realloc(), and talloc_chunk::size.

Here is the call graph for this function:

◆ talloc_reference_count()

size_t talloc_reference_count ( const void *  ptr)

Definition at line 909 of file talloc.c.

References talloc_reference_handle::next, talloc_chunk::refs, and talloc_chunk_from_ptr().

Referenced by talloc_report_depth_FILE_helper().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talloc_reference_destructor()

static int talloc_reference_destructor ( struct talloc_reference_handle handle)
static

Definition at line 279 of file talloc.c.

References _TLIST_REMOVE, talloc_reference_handle::ptr, talloc_chunk::refs, and talloc_chunk_from_ptr().

Referenced by _talloc_reference().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talloc_report()

void talloc_report ( const void *  ptr,
FILE *  f 
)

Definition at line 1025 of file talloc.c.

References talloc_reference_handle::ptr, and talloc_report_depth_file().

Referenced by talloc_report_null().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talloc_report_depth_cb()

void talloc_report_depth_cb ( const void *  ptr,
int  depth,
int  max_depth,
void(*)(const void *ptr, int depth, int max_depth, int is_ref, void *private_data)  callback,
void *  private_data 
)

Definition at line 924 of file talloc.c.

References talloc_chunk::child, talloc_chunk::flags, talloc_chunk::name, talloc_chunk::next, null_context, talloc_reference_handle::ptr, talloc_chunk_from_ptr(), TALLOC_FLAG_LOOP, TALLOC_MAGIC_REFERENCE, talloc_report_depth_cb(), and TC_PTR_FROM_CHUNK.

Referenced by talloc_report_depth_cb(), and talloc_report_depth_file().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talloc_report_depth_file()

void talloc_report_depth_file ( const void *  ptr,
int  depth,
int  max_depth,
FILE *  f 
)

Definition at line 1008 of file talloc.c.

References talloc_reference_handle::ptr, talloc_report_depth_cb(), and talloc_report_depth_FILE_helper().

Referenced by talloc_report(), and talloc_report_full().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talloc_report_depth_FILE_helper()

static void talloc_report_depth_FILE_helper ( const void *  ptr,
int  depth,
int  max_depth,
int  is_ref,
void *  _f 
)
static

Definition at line 962 of file talloc.c.

References talloc_reference_handle::ptr, talloc_get_name(), talloc_reference_count(), talloc_total_blocks(), and talloc_total_size().

Referenced by talloc_report_depth_file().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talloc_report_full()

void talloc_report_full ( const void *  ptr,
FILE *  f 
)

Definition at line 1017 of file talloc.c.

References talloc_reference_handle::ptr, and talloc_report_depth_file().

Referenced by ro_gui_window_handle_local_keypress(), and talloc_report_null_full().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talloc_report_null()

static void talloc_report_null ( void  )
static

Definition at line 1033 of file talloc.c.

References null_context, talloc_report(), and talloc_total_size().

Referenced by talloc_enable_leak_report().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talloc_report_null_full()

static void talloc_report_null_full ( void  )
static

Definition at line 1043 of file talloc.c.

References null_context, talloc_report_full(), and talloc_total_size().

Referenced by talloc_enable_leak_report_full().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talloc_set_name()

const char * talloc_set_name ( const void *  ptr,
const char *  fmt,
  ... 
)

Definition at line 589 of file talloc.c.

References talloc_chunk::name, and talloc_set_name_v().

Here is the call graph for this function:

◆ talloc_set_name_const()

void talloc_set_name_const ( const void *  ptr,
const char *  name 
)

Definition at line 737 of file talloc.c.

References _talloc_set_name_const(), and talloc_chunk::name.

Here is the call graph for this function:

◆ talloc_set_name_v()

static const char static const char * talloc_set_name_v ( const void *  ptr,
const char *  fmt,
va_list  ap 
)
inlinestatic

Definition at line 576 of file talloc.c.

References _talloc_set_name_const(), likely, talloc_chunk::name, talloc_chunk_from_ptr(), and talloc_vasprintf().

Referenced by talloc_init(), talloc_named(), and talloc_set_name().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talloc_show_parents()

void talloc_show_parents ( const void *  context,
FILE *  file 
)

Definition at line 1394 of file talloc.c.

References talloc_chunk::parent, talloc_chunk::prev, talloc_chunk_from_ptr(), talloc_get_name(), and TC_PTR_FROM_CHUNK.

Here is the call graph for this function:

◆ talloc_strdup()

char * talloc_strdup ( const void *  t,
const char *  p 
)

Definition at line 1118 of file talloc.c.

References _talloc_set_name_const(), likely, and talloc_memdup.

Referenced by box_a(), box_construct_element(), box_construct_text(), box_create_frameset(), box_embed(), box_get_attribute(), box_iframe(), box_image(), box_input(), box_input_text(), box_object(), box_select(), and form__select_process_selection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talloc_strndup()

char * talloc_strndup ( const void *  t,
const char *  p,
size_t  n 
)

Definition at line 1160 of file talloc.c.

References __talloc(), and _talloc_set_name_const().

Here is the call graph for this function:

◆ talloc_total_blocks()

size_t talloc_total_blocks ( const void *  ptr)

Definition at line 885 of file talloc.c.

References talloc_chunk::child, talloc_chunk::flags, talloc_chunk::next, talloc_chunk_from_ptr(), TALLOC_FLAG_LOOP, talloc_total_blocks(), and TC_PTR_FROM_CHUNK.

Referenced by talloc_report_depth_FILE_helper(), and talloc_total_blocks().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talloc_total_size()

size_t talloc_total_size ( const void *  ptr)

Definition at line 852 of file talloc.c.

References talloc_chunk::child, talloc_chunk::flags, talloc_chunk::next, null_context, talloc_chunk::size, talloc_chunk_from_ptr(), TALLOC_FLAG_LOOP, talloc_total_size(), and TC_PTR_FROM_CHUNK.

Referenced by talloc_report_depth_FILE_helper(), talloc_report_null(), talloc_report_null_full(), and talloc_total_size().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talloc_unlink()

int talloc_unlink ( const void *  context,
void *  ptr 
)

Definition at line 522 of file talloc.c.

References _talloc_free(), null_context, talloc_chunk::refs, talloc_chunk_from_ptr(), talloc_parent_chunk(), talloc_steal, talloc_unreference(), and TC_PTR_FROM_CHUNK.

Here is the call graph for this function:

◆ talloc_unreference()

static int talloc_unreference ( const void *  context,
const void *  ptr 
)
inlinestatic

Definition at line 494 of file talloc.c.

References _talloc_free(), talloc_reference_handle::next, null_context, talloc_chunk::refs, talloc_chunk_from_ptr(), talloc_parent_chunk(), TC_PTR_FROM_CHUNK, and unlikely.

Referenced by talloc_unlink().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talloc_vasprintf()

char * talloc_vasprintf ( const void *  t,
const char *  fmt,
va_list  ap 
)

Definition at line 1183 of file talloc.c.

References __talloc(), _talloc_set_name_const(), and va_copy.

Referenced by talloc_asprintf(), talloc_set_name_v(), and talloc_vasprintf_append().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ talloc_vasprintf_append()

char * talloc_vasprintf_append ( char *  s,
const char *  fmt,
va_list  ap 
)

Realloc s to append the formatted result of fmt and ap, and return s, which may have moved.

Good for gradually accumulating output into a string buffer.

Definition at line 1231 of file talloc.c.

References _talloc_set_name_const(), talloc_chunk::size, talloc_chunk_from_ptr(), talloc_realloc, talloc_vasprintf(), and va_copy.

Referenced by talloc_asprintf_append().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ autofree_context

void* autofree_context
static

Definition at line 108 of file talloc.c.

Referenced by talloc_autofree(), talloc_autofree_context(), and talloc_autofree_destructor().

◆ null_context

void* null_context
static