8 typedef struct _F_BLOCK
10 F_BLOCK_STATUS status;
12 /* In bytes, includes this header */
15 /* Filled in on image load */
16 struct _F_BLOCK *next_free;
18 /* Used during compaction */
19 struct _F_BLOCK *forwarding;
27 void new_heap(F_HEAP *heap, CELL size);
28 void build_free_list(F_HEAP *heap, CELL size);
29 void *heap_allot(F_HEAP *heap, CELL size);
30 void mark_block(F_BLOCK *block);
31 void unmark_marked(F_HEAP *heap);
32 void free_unmarked(F_HEAP *heap);
33 void heap_usage(F_HEAP *heap, CELL *used, CELL *total_free, CELL *max_free);
34 CELL heap_size(F_HEAP *heap);
35 CELL compute_heap_forwarding(F_HEAP *heap);
36 void compact_heap(F_HEAP *heap);
38 INLINE F_BLOCK *next_block(F_HEAP *heap, F_BLOCK *block)
40 CELL next = ((CELL)block + block->size);
41 if(next == heap->segment->end)
44 return (F_BLOCK *)next;
47 INLINE F_BLOCK *first_block(F_HEAP *heap)
49 return (F_BLOCK *)heap->segment->start;
52 INLINE F_BLOCK *last_block(F_HEAP *heap)
54 return (F_BLOCK *)heap->segment->end;