heapdebug

Option Type Default Value #pragma options C C++
-qoption noheapdebug   x x

Syntax

    -qheapdebug

Purpose
Enables debug versions of memory management functions.

Notes
The -qheapdebug options specifies that the debug versions of memory management functions (_debug_calloc, _debug_malloc, new, etc.) be used in place of regular memory management functions. This option defines the __DEBUG_ALLOC__ macro.

By default, the compiler uses the regular memory management functions (calloc, malloc, new, etc.) and does not preinitialize their local storage.

This option makes the C compiler search both usr/vac/include and usr/include.

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

xlC -qheapdebug myprogram.c -o testing 


Debugging Memory Heaps
Memory Management Functions
Managing Memory with Multiple Memory Heaps


Debug Programs with Heap Memory


List of Batch Compiler Options and Their Defaults
Options that Specify Debugging Features
_debug_calloc - Allocate and Initialize Memory
_debug_free - Free Allocated Memory
_debug_heapmin - Free Unused Memory in the Default Heap
_debug_malloc - Allocate Memory
_debug_memcpy - Copy Bytes
_debug_memmove - Copy Bytes
_debug_memset - Set Bytes to Value
_debug_realloc - Reallocate Memory Block
_debug_strcat - Concatenate Strings
_debug_strcpy - Copy Strings
_debug_strncat - Concatenate Strings
_debug_strncpy - Copy Strings
_debug_strnset - Set Characters in String
_debug_strset - Set Characters in String
_debug_ucalloc - Reserve and Initialize Memory from User Heap
_debug_uheapmin - Free Unused Memory in User Heap
_debug_umalloc - Reserve Memory Block from User Heap
_uheap_check - Validate User Heap Memory
_uheapset - Validate and Set Memory Heap
_uheap_walk - Return Information about Memory Heap
Equivalent Batch Compile-Link and Incremental Build Options