cxDataManAbortOnError - modify the error handling behaviour of the IRIS Explorer data allocation manager.

#include <cx/ModuleCommand.h>

void cxDataManAbortOnError(int abort)
subroutine cxDataManAbortOnError(abort)
integer abort


If abort is non-zero, the IRIS Explorer data allocation manager will cause user code to return automatically when a memory error occurs. This is the default action. If abort is zero, this functionality is disabled.

Prior to version 5.0 of IRIS Explorer, there were a number of API functions for detection and recovery from memory errors. The intention was that module writers would check for errors after every API function call allocating memory to IRIS Explorer. If an error occurred, the module code should free any memory it had already allocated and return cleanly. In practice, few modules do any error checking and those that do rarely return cleanly. Therefore when memory errors occurred, invariably modules would crash as they tried to access invalid pointers.

Version 5.0 of IRIS Explorer implements a new mechanism for handling memory errors. Now when an error occurs in IRIS Explorer memory allocation, the module returns automatically from the user code. This means that memory already allocated by the module cannot be freed, but it allows the user to save their work and increase the available memory without modules crashing.

There may be some situations where you do not want your code to return automatically when an error occurs. For example, you may be trying to gauge how much memory is available by allocating larger and larger blocks of memory. The cxDataManAbortOnError function allows you to disable and re-enable this functionality. When this mechanism is disabled, you can check for memory errors by checking for NULL return values from the data allocation routines.

[ Documentation Home ]