Lines Matching defs:mlist

175 dr_memlist_delete(struct memlist *mlist)
179 for (ml = mlist; ml; ml = mlist) {
180 mlist = ml->ml_next;
221 dr_memlist_coalesce(struct memlist *mlist)
225 if ((mlist == NULL) || (mlist->ml_next == NULL))
228 while (mlist->ml_next) {
229 end = mlist->ml_address + mlist->ml_size;
230 if (mlist->ml_next->ml_address <= end) {
233 nend = mlist->ml_next->ml_address +
234 mlist->ml_next->ml_size;
236 mlist->ml_size += (nend - end);
237 nl = mlist->ml_next;
238 mlist->ml_next = mlist->ml_next->ml_next;
242 if (mlist->ml_next)
243 mlist->ml_next->ml_prev = mlist;
245 mlist = mlist->ml_next;
252 memlist_dump(struct memlist *mlist)
256 if (mlist == NULL)
258 else for (ml = mlist; ml; ml = ml->ml_next)
264 dr_memlist_dup(struct memlist *mlist)
268 if (mlist == NULL)
273 for (; mlist; mlist = mlist->ml_next) {
275 (*mlp)->ml_address = mlist->ml_address;
276 (*mlp)->ml_size = mlist->ml_size;
287 dr_memlist_add_span(struct memlist *mlist, uint64_t base, uint64_t len)
294 if (mlist == NULL) {
295 mlist = GETSTRUCT(struct memlist, 1);
296 mlist->ml_address = base;
297 mlist->ml_size = len;
298 mlist->ml_next = mlist->ml_prev = NULL;
300 return (mlist);
303 for (tl = ml = mlist; ml; tl = ml, ml = ml->ml_next) {
313 if (mlist == ml)
314 mlist = nl;
339 dr_memlist_coalesce(mlist);
341 return (mlist);
345 dr_memlist_del_span(struct memlist *mlist, uint64_t base, uint64_t len)
350 if (mlist == NULL)
354 if ((end <= mlist->ml_address) || (base == end))
355 return (mlist);
357 for (tl = ml = mlist; ml; tl = ml, ml = nlp) {
391 if (ml == mlist) {
392 if ((mlist = nlp) != NULL)
395 if (mlist == NULL)
408 return (mlist);
415 dr_memlist_cat_span(struct memlist *mlist, uint64_t base, uint64_t len)
422 if (mlist == NULL) {
423 mlist = GETSTRUCT(struct memlist, 1);
424 mlist->ml_address = base;
425 mlist->ml_size = len;
426 mlist->ml_next = mlist->ml_prev = NULL;
428 return (mlist);
431 for (tl = ml = mlist; ml; tl = ml, ml = ml->ml_next) {
440 if (mlist == ml)
441 mlist = nl;
455 return (mlist);