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