NetSurf
|
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
Go to the source code of this file.
Typedefs | |
typedef void | TALLOC_CTX |
Functions | |
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) |
size_t | talloc_reference_count (const void *ptr) |
void * | _talloc_reference (const void *context, const void *ptr) |
int | talloc_unlink (const void *context, void *ptr) |
const char * | talloc_set_name (const void *ptr, const char *fmt,...) PRINTF_ATTRIBUTE(2 |
const char void | talloc_set_name_const (const void *ptr, const char *name) |
void * | talloc_named (const void *context, size_t size, const char *fmt,...) PRINTF_ATTRIBUTE(3 |
void void * | talloc_named_const (const void *context, size_t size, const char *name) |
const char * | talloc_get_name (const void *ptr) |
void * | talloc_check_name (const void *ptr, const char *name) |
void * | talloc_parent (const void *ptr) |
const char * | talloc_parent_name (const void *ptr) |
void * | talloc_init (const char *fmt,...) PRINTF_ATTRIBUTE(1 |
void int | talloc_free (void *ptr) |
void | talloc_free_children (void *ptr) |
void * | _talloc_realloc (const void *context, void *ptr, size_t size, const char *name) |
void * | _talloc_steal (const void *new_ctx, const void *ptr) |
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) |
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) |
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) |
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_strndup (const void *t, const char *p, size_t n) |
char * | talloc_append_string (const void *t, char *orig, const char *append) |
char * | talloc_vasprintf (const void *t, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2 |
char char * | talloc_vasprintf_append (char *s, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2 |
char char char * | talloc_asprintf (const void *t, const char *fmt,...) PRINTF_ATTRIBUTE(2 |
char char char char * | talloc_asprintf_append (char *s, const char *fmt,...) PRINTF_ATTRIBUTE(2 |
char char char char 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) |
void * | talloc_autofree_context (void) |
size_t | talloc_get_size (const void *ctx) |
void * | talloc_find_parent_byname (const void *ctx, const char *name) |
void | talloc_show_parents (const void *context, FILE *file) |
int | talloc_is_parent (const void *context, const void *ptr) |
#define __location__ __FILE__ ":" __TALLOC_STRING_LINE3__ |
#define __TALLOC_STRING_LINE2__ | ( | s | ) | __TALLOC_STRING_LINE1__(s) |
#define __TALLOC_STRING_LINE3__ __TALLOC_STRING_LINE2__(__LINE__) |
#define talloc | ( | ctx, | |
type | |||
) | (type *)talloc_named_const(ctx, sizeof(type), #type) |
#define talloc_array_ptrtype | ( | ctx, | |
ptr, | |||
count | |||
) | (_TALLOC_TYPEOF(ptr))talloc_array_size(ctx, sizeof(*(ptr)), count) |
#define talloc_array_size | ( | ctx, | |
size, | |||
count | |||
) | _talloc_array(ctx, size, count, __location__) |
#define talloc_find_parent_bytype | ( | ptr, | |
type | |||
) | (type *)talloc_find_parent_byname(ptr, #type) |
#define talloc_get_type | ( | ptr, | |
type | |||
) | (type *)talloc_check_name(ptr, #type) |
#define talloc_memdup | ( | t, | |
p, | |||
size | |||
) | _talloc_memdup(t, p, size, __location__) |
#define talloc_move | ( | ctx, | |
ptr | |||
) | (_TALLOC_TYPEOF(*(ptr)))_talloc_move((ctx),(void *)(ptr)) |
#define talloc_new | ( | ctx | ) | talloc_named_const(ctx, 0, "talloc_new: " __location__) |
#define talloc_ptrtype | ( | ctx, | |
ptr | |||
) | (_TALLOC_TYPEOF(ptr))talloc_size(ctx, sizeof(*(ptr))) |
#define talloc_realloc_size | ( | ctx, | |
ptr, | |||
size | |||
) | _talloc_realloc(ctx, ptr, size, __location__) |
#define talloc_reference | ( | ctx, | |
ptr | |||
) | (_TALLOC_TYPEOF(ptr))_talloc_reference((ctx),(ptr)) |
#define talloc_set_destructor | ( | ptr, | |
function | |||
) | _talloc_set_destructor((ptr), (int (*)(void *))(function)) |
#define talloc_set_type | ( | ptr, | |
type | |||
) | talloc_set_name_const(ptr, #type) |
#define talloc_size | ( | ctx, | |
size | |||
) | talloc_named_const(ctx, size, __location__) |
#define talloc_steal | ( | ctx, | |
ptr | |||
) | (_TALLOC_TYPEOF(ptr))_talloc_steal((ctx),(ptr)) |
#define talloc_zero | ( | ctx, | |
type | |||
) | (type *)_talloc_zero(ctx, sizeof(type), #type) |
#define talloc_zero_size | ( | ctx, | |
size | |||
) | _talloc_zero(ctx, size, __location__) |
typedef void TALLOC_CTX |
void * _talloc | ( | const void * | context, |
size_t | size | ||
) |
Definition at line 729 of file talloc.c.
References __talloc(), and talloc_chunk::size.
char char char char 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.
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.
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.
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().
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.
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.
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().
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().
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().
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.
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.
char char char * talloc_asprintf | ( | const void * | t, |
const char * | fmt, | ||
... | |||
) |
char char char char * talloc_asprintf_append | ( | char * | s, |
const char * | fmt, | ||
... | |||
) |
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.
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.
void talloc_disable_null_tracking | ( | void | ) |
Definition at line 1063 of file talloc.c.
References _talloc_free(), and null_context.
void talloc_enable_leak_report | ( | void | ) |
Definition at line 1072 of file talloc.c.
References talloc_enable_null_tracking(), and talloc_report_null().
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().
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().
void * talloc_find_parent_byname | ( | const void * | ctx, |
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.
void 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().
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.
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().
size_t talloc_get_size | ( | const void * | ctx | ) |
Definition at line 1355 of file talloc.c.
References talloc_chunk::size, and talloc_chunk_from_ptr().
int talloc_increase_ref_count | ( | const void * | ptr | ) |
Definition at line 266 of file talloc.c.
References null_context, talloc_reference, and unlikely.
void * talloc_init | ( | const char * | fmt, |
... | |||
) |
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().
void * talloc_named | ( | const void * | context, |
size_t | size, | ||
const char * | fmt, | ||
... | |||
) |
void 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.
void * talloc_parent | ( | const void * | ptr | ) |
Definition at line 191 of file talloc.c.
References talloc_parent_chunk(), and TC_PTR_FROM_CHUNK.
const char * talloc_parent_name | ( | const void * | ptr | ) |
Definition at line 200 of file talloc.c.
References talloc_chunk::name, and talloc_parent_chunk().
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.
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().
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().
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().
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().
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().
const char * talloc_set_name | ( | const void * | ptr, |
const char * | fmt, | ||
... | |||
) |
const char 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.
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.
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().
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().
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().
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().
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.
char * talloc_vasprintf | ( | const void * | t, |
const char * | fmt, | ||
va_list | ap | ||
) |
char char * talloc_vasprintf_append | ( | char * | s, |
const char * | fmt, | ||
va_list | ap | ||
) |