This vector allocates space in a user heap.
Call Parameters | Return Parameters | ||
---|---|---|---|
D0.L | Unused | D0.L | Error code. |
D1.L | Number of bytes required. | 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 | A0.L | Address of allocated area. |
A1.L | Unused | A1.L | Corrupted. |
A2.L | Unused | A2.L | Corrupted. |
A3.L | Unused | A3.L | Corrupted. |
ERR_OM | Out of memory. |
The example below shows how to obtain space from a user heap.
It is assumed that A6 points to the data space and that the address of the pointer to free space is in heapad(a6). See MM_LNKFR/MEM_REHP.
move.l #504,d1 ; Number of bytes needed lea heapad(a6),a0 ; Pointer to pointer to free space movea.w MM_ALLOC,a2 ; address of MM_ALLOC jsr (a2) ; Make the call bne.s Error_handler ; Oops!