-qheapdebug

Description

Enables debug versions of memory management functions.

Syntax

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

Notes

By default, the compiler uses the regular memory management functions such as (calloc, malloc, new) and does not preinitialize their local storage. The header files for the regular memory management functions are found in the system include directory.

The debug versions of these memory management functions, such as _debug_calloc, _debug_malloc, new, and so on, are found in the product include directory at usr/vacpp/include.

Specifying -qheapdebug changes the header file search order so the compiler can find the debug versions of the memory management functions. The compiler will search 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.

Specifying -qheapdebug also defines the __DEBUG_ALLOC__ macro.

Example

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

xlc++ -qheapdebug myprogram.c -o testing 

Related information