-
Declaration:
- procedure DumpHeap;
-
Description:
- DumpHeap dumps to standard output a summary of memory usage. It is called automatically
by the heaptrc unit when your program exits (by instaling an exit procedure), but it can be
called at any time
-
Errors:
- None.
-
See also:
- MarkHeap (240)
-
Declaration:
- procedure MarkHeap;
-
Description:
- MarkHeap marks all memory blocks with a special signature. You can use this if you think
that you corruped the memory.
-
Errors:
- None.
-
See also:
- DumpHeap (240)
-
Declaration:
- procedure SetExtraInfo( size : longint;func : FillExtraInfoType);
-
Description:
- You can use SetExtraInfo to store extra info in the blocks that the heaptrc unit reserves
when tracing getmem calls. Size indicates the size (in bytes) that the trace mechanism
should reserve for your extra information. For each call to getmem, func will be called, and
passed a pointer to the memory reserved.
When dumping the memory summary, the extra info is shown as Longint values.
-
Errors:
- You can only call SetExtraInfo if no memroy has been allocated yet. If memory was already
allocated prior to the call to SetExtraInfo, then an error will be displayed on standard error
output, and a DumpHeap (240) is executed.
-
See also:
- DumpHeap (240),SetHeapTraceOutput (242)
Listing: heapex/setinfo.pp
-
Declaration:
- Procedure SetHeapTraceOutput(const name : string);
-
Description:
- SetHeapTraceOutput sets the filename into which heap trace info will be written. By default
information is written to standard output, this function allows you to redirect the information
to a file with full filename name.
-
Errors:
- If the file cannot be written to, errors will occur when writing the trace.
-
See also:
- SetExtraInfo (240)