24.05.2014 Views

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

C Function prototype <strong>Fortran</strong> usage example Description<br />

void _dump_allocated_delta<br />

(int size);<br />

integer(4) :: size=4<br />

call _dump_allocated_delta &<br />

(%val(size))<br />

This routine prints in<strong>for</strong>mation to<br />

stderr about each memory block<br />

that is currently allocated or was<br />

allocated using the debug memory<br />

management routines since the last<br />

call to _dump_allocated or<br />

_dump_allocated_delta. size indicates<br />

how many bytes of each memory<br />

block are to be printed, as follows:<br />

Negative size<br />

All bytes are<br />

displayed.<br />

0 size No bytes are<br />

displayed.<br />

Positive size<br />

Specified number<br />

of bytes are<br />

displayed.<br />

void heap_check(void); call _heap_check() This routine does consistency<br />

checking <strong>for</strong> memory blocks that<br />

have been allocated using the<br />

debug memory-management<br />

routines. It checks that your<br />

program has not overwritten freed<br />

storage or memory outside the<br />

bounds of allocated blocks.<br />

All of the debug<br />

memory-allocation routines (debug<br />

version of malloc, and so on)<br />

invoke heap_check automatically. It<br />

may also be invoked explicitly in<br />

areas of code where a user believes<br />

there may be memory problems.<br />

Calling heap_check frequently can<br />

increase the memory requirements<br />

and affect the per<strong>for</strong>mance of a<br />

program. The HD_SKIP<br />

environment variable may be used<br />

to control how often the debug<br />

memory procedures check the<br />

heap.<br />

Note that the errors are detected<br />

when the heap_check routine is<br />

invoked, not at the point of error<br />

in the program.<br />

Environment Variables<br />

The debug libraries support the following environment variables:<br />

HD_SKIP=increment [,start]<br />

Control how often heap_check is invoked from the<br />

debug versions of the memory-management<br />

routines. increment indicates how often you want<br />

the debug functions to check the heap. start<br />

specifies that the skipping of heap checks should<br />

begin after the debug memory routines have been<br />

Problem Determination and Debugging 385

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!