MT_ALLOC/SMS_ALHP
This trap allocates space from a user heap.
Call Parameters | Return Parameters | ||
---|---|---|---|
D0.B | $0C | D0.L | Corrupted? |
D1.L | Number of bytes required in user heap. | D1.L | Number of bytes allocated. |
D2.L | Unused. | D2.L | Corrupted. |
D3.L | Unused. | D3.L | Corrupted. |
A0.L | Pointer to pointer to free space (relative A6). | A0.L | Address of area allocated. |
A1.L | Unused. | A1.L | Corrupted. |
A2.L | Unused. | A2.L | Corrupted. |
A3.L | Unused. | A3.L | Corrupted. |
Errors
ERR_OM | Out of memory (in user heap). |
Notes
* All registers not shown above are not used on entry and are preserved on exit.
* A user heap is an area of memory, maybe in the common heap, set aside for use by a single job. The job can allocate areas of this user heap for its own needs, and deallocate them as required. This stops, or reduces fragmentation of the common heap which is used by every task in the system. See here for more information on heaps.
Example
This example show the use of this, and other, heap manipulation traps.