4 * [Generated from heap, 25 September 1996]
7 #if !defined(__CC_NORCROFT) || !defined(__arm)
8 #error You must use the Norcroft ARM Compiler for Sapphire programs
11 #pragma include_only_once
12 #pragma force_top_level
21 /*----- Overview ----------------------------------------------------------*
33 /* --- heap_init --- *
39 * Use: Initialises the heap system for use.
42 extern routine heap_init;
44 /* --- heap_useHeap --- *
50 * Use: Registers the resizing heap as the current allocator.
53 extern routine heap_useHeap;
55 /* --- heap_info --- *
59 * On exit: R0 == current heap size
60 * R1 == amount of memory free in the heap
61 * R2 == size of the largest block free
63 * Use: Describes the heap's current status.
66 extern routine heap_info;
68 /* --- heap_alloc --- *
70 * On entry: R0 == size of block wanted
72 * On exit: CC if enough memory was found and
73 * R0 == pointer to the block allocated
77 * Use: Allocates a block of at least a given size from a heap. If
78 * the heap is not big enough, more is claimed from the
82 extern routine heap_alloc;
84 /* --- heap_free --- *
86 * On entry: R0 == pointer to a block created with heap_alloc
90 * Use: Frees a block allocated using heap_alloc. It tries to
91 * shrink the heap as much as possible afterwards.
94 extern routine heap_free;
96 /* --- heap_reAlloc --- *
98 * On entry: R0 == pointer to block whose size we want to change
99 * R1 == the new size of the block
101 * On exit: CC if block was resized, and
102 * R0 == pointer to the block (which may have moved)
106 * Use: Changes the size of a heap block. If possible, the block's
107 * position is unchanged, but this may not always be the case.
109 * Note that changing a block's size to 0 is permitted.
112 extern routine heap_reAlloc;
114 /*----- That's all, folks -------------------------------------------------*/