MM_RECHP/MEM_RCHP - Vector $C2
This vector deallocates memory on the common heap. It should only be called in supervisor mode. The vector is atomic. The memory being deallocated should have been allocated using MM_ALCHP/MEM_ACHP.
Call Parameters | Return Parameters | ||
---|---|---|---|
D1.L | Unused. | D1.L | Corrupted. |
D2.L | Unused. | D2.L | Corrupted. |
D3.L | Unused. | D3.L | Corrupted. |
A0.L | Address of area to deallocate. | A0.L | Corrupted. |
A1.L | Unused. | A1.L | Corrupted. |
A2.L | Unused. | A2.L | Corrupted. |
A3.L | Unused. | A3.L | Corrupted. |
A6.L | System variables address | A6.L | Preserved. |
Errors
No errors are returned by this vector call.
Notes
- All registers not shown above are not used on entry and are preserved on exit.
- Must be called in supervisor mode only.
- Mainly used in device driver 'close' routines to deallocate space used for channel definition blocks and so on.
- This vector call is atomic.
Example
The example below shows the use of this vector to deallocate a previously allocated chunk of memory. For the sake of the example, the start address of the area is assumed to be on the top of the stack.
Kill_hp move.w MM_RECHP,A2 ; MM_RECHP vector address. movea.l (a7)+,a0 ; Unstack the start of the allocated area. ; Assume A6 is correct already. jsr (a2) ; Make the call. ... ; Carry on here.