Lines Matching refs:heap

140 typedef struct heap  struct
142 struct heap *next; argument
143 struct heap *prev; argument
159 #define HEAP_PTR_SIZE (sizeof (struct heap)) argument
164 static struct heap heap_base;
182 struct heap *heap; member
200 heap_ptr heap; local
202 for (heap = last_heap; heap; heap = heap->prev)
204 if (heap->start <= address && address <= heap->end)
205 return heap;
234 heap_ptr heap; local
238 for (heap = last_heap; heap; heap = heap->prev)
240 if (heap->start <= address && address <= heap->end)
244 if (! heap)
249 while (heap && address + size > heap->end)
251 heap = heap->next;
252 if (heap == NIL_HEAP)
254 address = heap->bloc_start;
259 if (heap == NIL_HEAP)
388 register heap_ptr heap; local
407 heap = find_heap (new_bloc->data);
408 heap->free = break_value;
411 new_bloc->heap = heap;
412 heap->last_bloc = new_bloc;
413 if (heap->first_bloc == NIL_BLOC)
414 heap->first_bloc = new_bloc;
441 relocate_blocs (bloc, heap, address) in relocate_blocs() argument
443 heap_ptr heap;
452 while (heap && address + b->size > heap->end)
454 heap = heap->next;
455 if (heap == NIL_HEAP)
457 address = heap->bloc_start;
462 if (heap == NIL_HEAP)
479 heap = last_heap;
526 update_heap_bloc_correspondence (bloc, heap) in update_heap_bloc_correspondence() argument
528 heap_ptr heap;
533 if (bloc != NIL_BLOC && bloc->prev != NIL_BLOC && bloc->prev->heap == heap)
536 heap->last_bloc = bloc->prev;
537 heap->free = bloc->prev->data + bloc->prev->size;
542 heap->first_bloc = NIL_BLOC;
543 heap->last_bloc = NIL_BLOC;
544 heap->free = heap->bloc_start;
552 while (heap)
554 if (heap->bloc_start <= b->data && b->data <= heap->end)
556 heap = heap->next;
559 heap->first_bloc = NIL_BLOC;
560 heap->last_bloc = NIL_BLOC;
561 heap->free = heap->bloc_start;
565 heap->free = b->data + b->size;
566 heap->last_bloc = b;
567 if (heap->first_bloc == NIL_BLOC)
568 heap->first_bloc = b;
571 b->heap = heap;
576 heap = heap->next;
577 while (heap)
579 heap->first_bloc = NIL_BLOC;
580 heap->last_bloc = NIL_BLOC;
581 heap->free = heap->bloc_start;
582 heap = heap->next;
595 heap_ptr heap; local
602 for (heap = first_heap; heap != NIL_HEAP; heap = heap->next)
604 if (heap->bloc_start <= bloc->data && bloc->data <= heap->end)
608 if (heap == NIL_HEAP)
617 while (heap)
619 if (heap->bloc_start <= address && address <= heap->end)
621 heap = heap->prev;
624 if (! relocate_blocs (bloc, heap, address))
650 update_heap_bloc_correspondence (bloc, heap);
664 heap_ptr heap = bloc->heap; local
689 if (heap->first_bloc == bloc)
691 if (bloc->next->heap == heap)
692 heap->first_bloc = bloc->next;
694 heap->first_bloc = heap->last_bloc = NIL_BLOC;
696 if (heap->last_bloc == bloc)
698 if (bloc->prev->heap == heap)
699 heap->last_bloc = bloc->prev;
701 heap->first_bloc = heap->last_bloc = NIL_BLOC;