Turning Memory Debugging Features On and Off

To use the memory debugging functions from C, you must use the following functions:

Aget_memory_debug_flag()   

This function gets the current state of the memory debugging feature. It returns an int.

Aset_memory_debug_flag(int flag)   

This function sets the current state of the memory debugging feature. The int values are described as follows:

The memory description value, as used by the runtime, is the low six bits (though currently only three bits are used). In other words, the memory description value can be retrieved by ANDing the returned flag with 0x003F.

The memory tracking feature is turned on if (flag & 0x0040) is non-zero.

The memory bounds checking feature is turned on if (flag & 0x0080) is non-zero.

You can turn on memory handling descriptions by calling the function:

void Aset_mem_file_name(const char *filename);

Note that if memory descriptions are turned on but a filename is not given, memory descriptions are not reported.