This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
Control the extra checking for memory allocation
#include <malloc.h> int mallopt( int cmd, int value );
See the Description section for more details.
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The mallopt() function controls the extra checking of memory allocation.
Options used to enable additional checks in the library include:
The value argument can be:
The value argument can be:
The value argument can be:
Use one of the following for the value arguments:
Symbolic name | Value | Description |
---|---|---|
M_HANDLE_IGNORE | 0 | Cause the program to dump a core file. |
M_HANDLE_ABORT | 1 | Terminate execution with a call to abort() |
M_HANDLE_ABORT | 2 | Exit immediately |
M_HANDLE_CORE | 3 | Cause the program to dump a core file |
M_HANDLE_SIGNAL | 4 | Stop the program when this error occurs |
For details, see "Controlling the level of checking" in the Heap Analysis: Making Memory Errors a Thing of the Past chapter of the Neutrino Programmer's Guide.
See the Heap Analysis: Making Memory Errors a Thing of the Past chapter of the Neutrino Programmer's Guide. |
0 on success, or -1 if an error occurs (errno is set).
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
calloc(), free(), mallinfo(), malloc(), realloc()
Heap Analysis: Making Memory Errors a Thing of the Past chapter of the Neutrino Programmer's Guide