-qheapdebug

Category

Error checking and debugging

Pragma equivalent

None.

Purpose

Enables debug versions of memory management functions.

The compiler ships a set of "debug" versions of the standard memory management functions defined in stdlib.h (such as _debug_calloc and _debug_malloc); the header files for these functions are found in the product include directory (/opt/IBM/xlc/13.1.0/include). By default, the compiler uses the regular memory management functions (such as calloc and malloc) and does not preinitialize their local storage. When -qheapdebug is in effect, the compiler searches for header files first in the product include directory, where the debug versions of memory management functions are stored, and then in the system include directory.

Syntax

Read syntax diagramSkip visual syntax diagram
        .-noheapdebug-.   
>>- -q--+-heapdebug---+----------------------------------------><

Defaults

-qnoheapdebug

Usage

For complete information on the debug memory management functions, see Memory debug library functions.
Note: 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.

Predefined macros

__DEBUG_ALLOC__ is defined to 1 when -qheapdebug is in effect; otherwise, it is undefined.

Examples

To compile myprogram.c with the debug versions of memory management functions, enter:

xlc -qheapdebug myprogram.c -o testing 

Related information