Memory debug library functions
This appendix contains reference information about the XL C compiler
memory debug library functions, which are extensions of the standard
C memory management functions. The appendix is divided into two sections:
- Memory allocation debug functions describes the debug versions of the standard library functions for allocating heap memory.
- String handling debug functions describes the debug versions of the standard library functions for manipulating strings.
Notes:
- The memory debug library supports only extensions for the memory management functions that are described in this document.
- The compiler supports the memory allocation debug functions, but IBM has no plans to change or enhance these functions, and these functions will be removed in a future release. If you use these functions to debug memory problems in your programs, you can migrate to the AIX® debug malloc tool to achieve equivalent functionality. For details of the AIX debug malloc tool, see http://publib16.boulder.ibm.com/pseries/index.htm.
To use these debug versions, you can do either of the
following operations:
- In your source code, prefix any of the default or user-defined-heap memory management functions with _debug_.
- If you do not want to make changes to the source code, compile with the -qheapdebug option. This option maps all calls to memory management functions to their debug version counterparts. To prevent a call from being mapped, parenthesize the function name.
All of the examples provided in this appendix assume compilation with the -qheapdebug option.