18ROXML_STATIC ROXML_INT
inline void roxml_release_last(
void *data)
23 while ((ptr->
prev != NULL) && (ptr->
prev->id != pthread_self()))
26 if (ptr->
prev == NULL)
29 to_delete = ptr->
prev;
31 if (to_delete->
next) {
32 to_delete->
prev->next = to_delete->
next;
33 to_delete->
next->prev = to_delete->
prev;
39 to_delete->
prev->next = NULL;
44 for (i = 0; i < to_delete->
occ; i++)
45 free(((
void **)(to_delete->
ptr))[i]);
54ROXML_STATIC ROXML_INT
inline void roxml_release_all(
void *data)
68 for (i = 0; i < to_delete->
occ; i++)
69 free(((
void **)(to_delete->
ptr))[i]);
72 to_delete->
ptr = NULL;
78ROXML_STATIC ROXML_INT
inline void roxml_release_pointer(
void *data)
83 while ((ptr->
next != NULL) && (ptr->
next->ptr != data))
86 if (ptr->
next == NULL)
89 to_delete = ptr->
next;
90 if (to_delete->
next) {
91 to_delete->
next->prev = ptr;
101 for (i = 0; i < to_delete->
occ; i++)
102 free(((
void **)(to_delete->
ptr))[i]);
104 free(to_delete->
ptr);
112 roxml_release_last(data);
114 roxml_release_all(data);
116 roxml_release_pointer(data);
127 while (cell->
next != NULL)
134 cell->
next->next = NULL;
135 cell->
next->prev = cell;
138 cell->
id = pthread_self();
140 cell->
ptr = calloc(num, size);
memory_cell_t head_cell
head of memory manager
ROXML_API void roxml_release(void *data)
memory cleanning function
ROXML_INT void * roxml_malloc(int size, int num, int type)
alloc memory function
XML internal memory management module.
struct memory_cell * prev
struct memory_cell * next