Eina_Trash_Group

Langue: en

Version: 377904 (fedora - 01/12/10)

Section: 3 (Bibliothèques de fonctions)

NAME

Trash -

Data Structures


struct _Eina_Trash
Type for a generic container of unused allocated pointer.

Defines


#define EINA_TRASH_CLEAN(trash, data) while ((data = eina_trash_pop(trash))
Macro to remove all pointer from the trash.

Typedefs


typedef struct _Eina_Trash Eina_Trash
Type for a generic container of unused allocated pointer.

Functions


static void eina_trash_init (Eina_Trash **trash) EINA_ARG_NONNULL(1)

static void eina_trash_push (Eina_Trash **trash, void *data) EINA_ARG_NONNULL(1)

static void * eina_trash_pop (Eina_Trash **trash) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT

Define Documentation

#define EINA_TRASH_CLEAN(trash, data) while ((data = eina_trash_pop(trash))

Macro to remove all pointer from the trash. Parameters:

trash The trash to clean.
data The pointer extracted from the trash.

This macro allow the cleaning of trash in an easy way. It will remove all pointers from trash until it's empty.

This macro can be used for freeing the data in the trash, like in the following example:

  Eina_Trash *trash = NULL;
  char *data;
 
  // trash is filled with pointer to some duped strings.
 
  EINA_TRASH_CLEAN(&trash, data)
    free(data);
 

Note:

this macro is usefull when you implement some memory pool.

Author

Generated automatically by Doxygen for Eina from the source code.