Lines Matching refs:mem2
373 struct mem *mem, *mem2;
421 mem2 = (struct mem *)(void *)&ram[mem->next];
422 if(mem2->used == 0) {
426 next = mem2->next;
429 if (lfree == mem2) {
432 mem2 = (struct mem *)(void *)&ram[ptr2];
433 mem2->used = 0;
435 mem2->next = next;
437 mem2->prev = ptr;
440 /* last thing to restore linked list: as we have moved mem2,
441 * let 'mem2->next->prev' point to mem2 again. but only if mem2->next is not
443 if (mem2->next != MEM_SIZE_ALIGNED) {
444 ((struct mem *)(void *)&ram[mem2->next])->prev = ptr2;
457 mem2 = (struct mem *)(void *)&ram[ptr2];
458 if (mem2 < lfree) {
459 lfree = mem2;
461 mem2->used = 0;
462 mem2->next = mem->next;
463 mem2->prev = ptr;
465 if (mem2->next != MEM_SIZE_ALIGNED) {
466 ((struct mem *)(void *)&ram[mem2->next])->prev = ptr2;
472 next struct mem is used but size between mem and mem2 is not big enough
497 struct mem *mem, *mem2;
559 * struct mem would fit in but no data between mem2 and mem2->next
565 /* create mem2 struct */
566 mem2 = (struct mem *)(void *)&ram[ptr2];
567 mem2->used = 0;
568 mem2->next = mem->next;
569 mem2->prev = ptr;
574 if (mem2->next != MEM_SIZE_ALIGNED) {
575 ((struct mem *)(void *)&ram[mem2->next])->prev = ptr2;
579 /* (a mem2 struct does no fit into the user data space of mem and mem->next will always
582 * -> near fit or excact fit: do not split, no mem2 creation