CBL_MEM_VALIDATE

Validates memory allocations, monitored freed memory, and, if the operating system supports it, compacts memory heaps.

Syntax:
call "CBL_MEM_VALIDATE" using by value     flags
                              by reference param
                              returning    status-code
Parameters:
Using call prototype (see Library Routines - Key) Picture (32-bit systems)
flags cblt-x4-comp-5 pic x(4) comp-5.
param Group predefined as cblt-mem-validate-param Group containing
cblte-mv-version cblt-x4-comp-5 pic x(4) comp-5.
cblte-mv-flags cblt-x4-comp-5 pic x(4) comp-5.
cblte-mv-type cblt-x4-comp-5 pic x(4) comp-5.
cblte-mv-size cblt-x4-comp-5 pic x(4) comp-5.
cblte-mv-address cblt-pointer pointer
status-code See Library Routines - Key
On Entry:
flags Validation control flags:
Bit Meaning
0
0 No action
1 Validate all memory allocations
1
0 No action
1 Validate all freed memory
2-30 Reserved for future use. Must be set to zero.
31
0 No action
1 Compact memory
cblte-mv-version Parameter block version; must be zero.
On Exit:
param Fields are set only if the routine returns 1000
cblte-mv-flags Information flags:
Bit Meaning
0
0 cblte-mv-address not set
1 cblte-mv-address contains address of corrupted memory block
1
0 cblte-mv-address is user data address
1 cblte-mv-address is memory header address
2
0 cblte-mv-size not set
1 cblte-mv-size contains size of corrupt memory block
3
0 cblte-mv-type not set
1 cblte-mv-type contains type of corrupt memory block
4
0 Corruption in allocated memory
1 Corruption in freed memory
5
0 Corruption detected by run-time system
1 Corruption detected by operating system
6-31 Reserved for future use
status-code Status of operation:
0 All memory allocations are intact
1000 Memory corruption detected
1009 Invalid parameter specified
Comments:

Use this routine to validate memory allocations, monitored freed memory, and, if the operating system supports it, to compact memory heaps. Use this routine in preference to the validate memory strategy, set using the memory_strategy run-time tunable.

If you set the Compact memory flag, the routine attempts to compact memory to the extent that the operating system allows. There is no information flag setting that indicates the result.

See Also: