Macros | |
#define | EINA_LALLOC_ALLOC(function) ((Eina_Lalloc_Alloc)function) |
#define | EINA_LALLOC_FREE(function) ((Eina_Lalloc_Free)function) |
Typedefs | |
typedef Eina_Bool(* | Eina_Lalloc_Alloc) (void *user_data, int num) |
Type definition for the callback used to allocate new items in a lazy allocator. | |
typedef void(* | Eina_Lalloc_Free) (void *user_data) |
Type definition for the callback used to allocate new items in a lazy allocator. | |
typedef struct _Eina_Lalloc | Eina_Lalloc |
Public type definition for a lazy allocator. | |
Functions | |
EINA_API Eina_Lalloc * | eina_lalloc_new (void *data, Eina_Lalloc_Alloc alloc_cb, Eina_Lalloc_Free free_cb, int num_init) |
Creates a new lazy allocator. More... | |
EINA_API void | eina_lalloc_free (Eina_Lalloc *a) |
Frees the resources for a lazy allocator. More... | |
EINA_API Eina_Bool | eina_lalloc_element_add (Eina_Lalloc *a) |
Allocates one more of whatever the lazy allocator is allocating. More... | |
EINA_API Eina_Bool | eina_lalloc_elements_add (Eina_Lalloc *a, int num) |
Adds several elements to a lazy allocator. More... | |
#define EINA_LALLOC_ALLOC | ( | function | ) | ((Eina_Lalloc_Alloc)function) |
[in] | function | The function to allocate. |
#define EINA_LALLOC_FREE | ( | function | ) | ((Eina_Lalloc_Free)function) |
[in] | function | The function to free. |
EINA_API Eina_Lalloc * eina_lalloc_new | ( | void * | data, |
Eina_Lalloc_Alloc | alloc_cb, | ||
Eina_Lalloc_Free | free_cb, | ||
int | num_init | ||
) |
Creates a new lazy allocator.
[in] | data | The data for which memory will be allocated. |
[in] | alloc_cb | The callback to allocate memory for data items. |
[in] | free_cb | The callback to free memory for data items. |
[in] | num_init | The number of data items to initially allocate space for. |
References EINA_SAFETY_ON_NULL_RETURN_VAL.
EINA_API void eina_lalloc_free | ( | Eina_Lalloc * | a | ) |
Frees the resources for a lazy allocator.
[in,out] | a | The lazy allocator to free. |
References EINA_SAFETY_ON_NULL_RETURN.
EINA_API Eina_Bool eina_lalloc_element_add | ( | Eina_Lalloc * | a | ) |
Allocates one more of whatever the lazy allocator is allocating.
[in,out] | a | The lazy allocator to add an item to. |
References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_TRUE.
EINA_API Eina_Bool eina_lalloc_elements_add | ( | Eina_Lalloc * | a, |
int | num | ||
) |
Adds several elements to a lazy allocator.
[in,out] | a | The lazy allocator to add items to. |
[in] | num | The number of elements to add. |
References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_TRUE.