Lines Matching full:info

73 static void unlink_block(ralloc_header *info);
74 static void unsafe_free(ralloc_header *info);
79 ralloc_header *info = (ralloc_header *) (((char *) ptr) - in get_header() local
81 assert(info->canary == CANARY); in get_header()
82 return info; in get_header()
85 #define PTR_FROM_HEADER(info) (((char *) info) + sizeof(ralloc_header)) argument
88 add_child(ralloc_header *parent, ralloc_header *info) in add_child() argument
91 info->parent = parent; in add_child()
92 info->next = parent->child; in add_child()
93 parent->child = info; in add_child()
95 if (info->next != NULL) in add_child()
96 info->next->prev = info; in add_child()
111 ralloc_header *info = (ralloc_header *) block; in ralloc_size() local
114 add_child(parent, info); in ralloc_size()
116 info->canary = CANARY; in ralloc_size()
118 return PTR_FROM_HEADER(info); in ralloc_size()
134 ralloc_header *child, *old, *info; in resize() local
137 info = realloc(old, size + sizeof(ralloc_header)); in resize()
139 if (info == NULL) in resize()
143 if (info != old && info->parent != NULL) { in resize()
144 if (info->parent->child == old) in resize()
145 info->parent->child = info; in resize()
147 if (info->prev != NULL) in resize()
148 info->prev->next = info; in resize()
150 if (info->next != NULL) in resize()
151 info->next->prev = info; in resize()
155 for (child = info->child; child != NULL; child = child->next) in resize()
156 child->parent = info; in resize()
158 return PTR_FROM_HEADER(info); in resize()
201 ralloc_header *info; in ralloc_free() local
206 info = get_header(ptr); in ralloc_free()
207 unlink_block(info); in ralloc_free()
208 unsafe_free(info); in ralloc_free()
212 unlink_block(ralloc_header *info) in unlink_block() argument
215 if (info->parent != NULL) { in unlink_block()
216 if (info->parent->child == info) in unlink_block()
217 info->parent->child = info->next; in unlink_block()
219 if (info->prev != NULL) in unlink_block()
220 info->prev->next = info->next; in unlink_block()
222 if (info->next != NULL) in unlink_block()
223 info->next->prev = info->prev; in unlink_block()
225 info->parent = NULL; in unlink_block()
226 info->prev = NULL; in unlink_block()
227 info->next = NULL; in unlink_block()
231 unsafe_free(ralloc_header *info) in unsafe_free() argument
235 while (info->child != NULL) { in unsafe_free()
236 temp = info->child; in unsafe_free()
237 info->child = temp->next; in unsafe_free()
242 if (info->destructor != NULL) in unsafe_free()
243 info->destructor(PTR_FROM_HEADER(info)); in unsafe_free()
245 free(info); in unsafe_free()
251 ralloc_header *info, *parent; in ralloc_steal() local
256 info = get_header(ptr); in ralloc_steal()
259 unlink_block(info); in ralloc_steal()
261 add_child(parent, info); in ralloc_steal()
267 ralloc_header *info; in ralloc_parent() local
272 info = get_header(ptr); in ralloc_parent()
273 return info->parent ? PTR_FROM_HEADER(info->parent) : NULL; in ralloc_parent()
297 ralloc_header *info = get_header(ptr); in ralloc_set_destructor() local
298 info->destructor = destructor; in ralloc_set_destructor()