| HeapWalk | Function (ROM Call 0x12C)

AMS 2.00 or higher | alloc.h

short HeapWalk (short function);

Verifies and dumps the contents of the heap.

HeapWall looks through the heap to verify it is valid. Then it prints the status of the heap, prints the size of each heap block and its handle, or prints the symbol table, according to the value of function. HeapWalk uses LIO_SendData to send the output through the link port.
The valid values for function, defined in the enum HeapWalkCmds, are:

H_WALK_VERIFY | The function just verifies the heap, and outputs nothing to the link port.
H_WALK_STATUS | The function outputs the total free space, maximum size of a free block, number of used and free blocks, and the number of locked blocks.
H_WALK_DUMP | The function outputs the heap status and the size of the heap block for each handle.
H_WALK_SYM | AMS 2.04 or higher: The function outputs the entire VAT.

Uses: ER_catch, LIO_SendData, memcpy, sprintf, strlen, pSymPG, SymFindFirst, SymFindFolderName, SymFindNext

See also: HeapShuffle, vat.h