Lines Matching refs:next

203 	struct memlist *prev, *next;
231 for (prev = NULL, next = *curmemlistp; next != NULL;
232 prev = next, next = next->ml_next) {
233 if (address > (next->ml_address + next->ml_size))
241 * Prepend to next.
243 if ((address + bytes) == next->ml_address) {
246 next->ml_address = address;
247 next->ml_size += bytes;
253 * Append to next.
255 if (address == (next->ml_address + next->ml_size)) {
258 if (next->ml_next) {
260 * don't overlap with next->ml_next
263 next->ml_next->ml_address) {
267 * Concatenate next and next->ml_next
270 next->ml_next->ml_address) {
271 struct memlist *mlp = next->ml_next;
273 if (next == *curmemlistp)
274 *curmemlistp = next->ml_next;
276 mlp->ml_address = next->ml_address;
277 mlp->ml_size += next->ml_size;
280 if (next->ml_prev)
281 next->ml_prev->ml_next = mlp;
282 mlp->ml_prev = next->ml_prev;
284 memlist_free_one(next);
289 next->ml_size += bytes;
294 /* don't overlap with next */
295 if ((address + bytes) > next->ml_address) {
301 * Insert before next.
304 dst->ml_next = next;
305 next->ml_prev = dst;
315 * End of list, prev is valid and next is NULL.
337 struct memlist *dst, *next;
342 for (next = *curmemlistp; next != NULL; next = next->ml_next) {
343 if ((address >= next->ml_address) &&
344 (address < next->ml_address + next->ml_size))
351 if (next == NULL) {
358 if (address + bytes > next->ml_address + next->ml_size) {
365 if (address == next->ml_address) {
369 if (bytes == next->ml_size) {
370 if (next == *curmemlistp)
371 *curmemlistp = next->ml_next;
372 if (next->ml_prev != NULL)
373 next->ml_prev->ml_next = next->ml_next;
374 if (next->ml_next != NULL)
375 next->ml_next->ml_prev = next->ml_prev;
377 memlist_free_one(next);
382 next->ml_address += bytes;
383 next->ml_size -= bytes;
391 if (address + bytes == next->ml_address + next->ml_size) {
395 next->ml_size -= bytes;
418 (next->ml_address + next->ml_size) - dst->ml_address;
419 next->ml_size = address - next->ml_address;
429 dst->ml_next = next->ml_next;
430 dst->ml_prev = next;
432 if (next->ml_next != NULL)
433 next->ml_next->ml_prev = dst;
434 next->ml_next = dst;