Lines Matching refs: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)
265 dr_memlist_dup(struct memlist *mlist)
269 if (mlist == NULL)
274 for (; mlist; mlist = mlist->ml_next) {
276 (*mlp)->ml_address = mlist->ml_address;
277 (*mlp)->ml_size = mlist->ml_size;
288 dr_memlist_add_span(struct memlist *mlist, uint64_t base, uint64_t len)
295 if (mlist == NULL) {
296 mlist = GETSTRUCT(struct memlist, 1);
297 mlist->ml_address = base;
298 mlist->ml_size = len;
299 mlist->ml_next = mlist->ml_prev = NULL;
301 return (mlist);
304 for (tl = ml = mlist; ml; tl = ml, ml = ml->ml_next) {
314 if (mlist == ml)
315 mlist = nl;
340 dr_memlist_coalesce(mlist);
342 return (mlist);
346 dr_memlist_del_span(struct memlist *mlist, uint64_t base, uint64_t len)
351 if (mlist == NULL)
355 if ((end <= mlist->ml_address) || (base == end))
356 return (mlist);
358 for (tl = ml = mlist; ml; tl = ml, ml = nlp) {
392 if (ml == mlist) {
393 if ((mlist = nlp) != NULL)
396 if (mlist == NULL)
409 return (mlist);
416 dr_memlist_cat_span(struct memlist *mlist, uint64_t base, uint64_t len)
423 if (mlist == NULL) {
424 mlist = GETSTRUCT(struct memlist, 1);
425 mlist->ml_address = base;
426 mlist->ml_size = len;
427 mlist->ml_next = mlist->ml_prev = NULL;
429 return (mlist);
432 for (tl = ml = mlist; ml; tl = ml, ml = ml->ml_next) {
441 if (mlist == ml)
442 mlist = nl;
456 return (mlist);