VLC 4.0.0-dev
|
Data Structures | |
struct | vlc_res |
Functions | |
static struct vlc_res ** | vlc_obj_res (vlc_object_t *obj) |
void * | vlc_objres_new (size_t size, void(*release)(void *)) |
Allocates an object resource. More... | |
void | vlc_objres_push (vlc_object_t *obj, void *data) |
Pushes an object resource on the object resources stack. More... | |
static void * | vlc_objres_pop (vlc_object_t *obj) |
void | vlc_objres_clear (vlc_object_t *obj) |
Releases all resources of an object. More... | |
void | vlc_objres_remove (vlc_object_t *obj, void *data, bool(*match)(void *, void *)) |
Releases one object resource explicitly. More... | |
static void | dummy_release (void *data) |
static bool | ptrcmp (void *a, void *b) |
void *() | vlc_obj_malloc (vlc_object_t *obj, size_t size) |
void *() | vlc_obj_calloc (vlc_object_t *obj, size_t nmemb, size_t size) |
static void * | vlc_obj_memdup (vlc_object_t *obj, const void *base, size_t len) |
char *() | vlc_obj_strdup (vlc_object_t *obj, const char *str) |
void() | vlc_obj_free (vlc_object_t *obj, void *ptr) |
|
static |
Referenced by vlc_obj_malloc().
|
static |
Referenced by vlc_obj_free().
void *() vlc_obj_calloc | ( | vlc_object_t * | obj, |
size_t | nmemb, | ||
size_t | size | ||
) |
References likely, mul_overflow, unlikely, and vlc_obj_malloc().
void() vlc_obj_free | ( | vlc_object_t * | obj, |
void * | ptr | ||
) |
References ptrcmp(), and vlc_objres_remove().
void *() vlc_obj_malloc | ( | vlc_object_t * | obj, |
size_t | size | ||
) |
References dummy_release(), likely, vlc_objres_new(), and vlc_objres_push().
Referenced by vlc_obj_calloc(), and vlc_obj_memdup().
|
static |
References likely, and vlc_obj_malloc().
Referenced by vlc_obj_strdup().
|
static |
References vlc_internals.
Referenced by vlc_objres_pop(), vlc_objres_push(), and vlc_objres_remove().
char *() vlc_obj_strdup | ( | vlc_object_t * | obj, |
const char * | str | ||
) |
References vlc_obj_memdup().
void vlc_objres_clear | ( | vlc_object_t * | obj | ) |
Releases all resources of an object.
All resources added with vlc_objres_add() are released in reverse order. The resource list is reset to empty.
obj | object whose resources to release |
References container_of, vlc_res::payload, vlc_res::release, and vlc_objres_pop().
Referenced by decoder_device_Open(), demux_Probe(), generic_start(), module_unneed(), vlc_decoder_device_Create(), vlc_decoder_device_Release(), vlc_encoder_Destroy(), vlc_gl_Delete(), vlc_gl_start(), vlc_tls_ClientCreate(), vlc_tls_ClientDelete(), vlc_tls_ServerCreate(), vlc_tls_ServerDelete(), vlc_window_Delete(), vlc_window_start(), vout_display_Delete(), and vout_display_New().
void * vlc_objres_new | ( | size_t | size, |
void(*)(void *) | release | ||
) |
Allocates an object resource.
size | storage size in bytes of the resource data |
release | callback to release the resource |
References add_overflow, vlc_res::payload, vlc_res::release, and unlikely.
Referenced by vlc_obj_malloc().
|
static |
References vlc_res::payload, vlc_res::prev, and vlc_obj_res().
Referenced by vlc_objres_clear().
void vlc_objres_push | ( | vlc_object_t * | obj, |
void * | data | ||
) |
Pushes an object resource on the object resources stack.
obj | object to allocate the resource for |
data | resource base address (as returned by vlc_objres_new()) |
References container_of, vlc_res::payload, vlc_res::prev, and vlc_obj_res().
Referenced by vlc_obj_malloc().
void vlc_objres_remove | ( | vlc_object_t * | obj, |
void * | data, | ||
bool(*)(void *, void *) | match | ||
) |
Releases one object resource explicitly.
If a resource associated with an object needs to be released explicitly earlier than normal, call this function. This is relatively slow and should be avoided.
obj | object whose resource to release |
data | private data for the comparison function |
match | comparison function to match the targeted resource |
References vlc_res::payload, vlc_res::prev, vlc_res::release, and vlc_obj_res().
Referenced by vlc_obj_free().