Function _momDebug() Foundation

Tests for errors in dynamic memory objects.

Syntax
XPPAPIRET _momDebug();
Return

Returns XPP_ERR_CORRUPTION if memory objects are found whose structures have been destroyed. Otherwise the return value is NULL.

Description

This function serves only as an aid when debugging C functions. It tests the structure of all dynamic memory objects and determines whether any writes beyond the limit of an object have occurred. It does not test whether the content of memory objects or container objects are correct.

Dynamic memory does not only contain the C API generated memory objects and containers, but also Xbase++ generated objects.

If _momDebug() returns an error it is always fatal, because it indicates that internal structures have been destroyed. When this is the case, an application becomes unpredictable and should be terminated.

Examples
/* 
Test memory for errors 
*/ 
#include "xppcon.h" 

if (_momDebug() != 0) 
{ 
/* Outputs debugging information and program terminates. */ 
} 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.