Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/m/mcheck.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/m/mcheck.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/m/mcheck.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/m/mcheck.html on line 8
Enable memory allocation routine consistency checks
#include <malloc.h>
int mcheck(
void (* abort_fn)(enum mcheck_status status));
- abort_fn
- A pointer to the callback function to invoke when an inconsistency
in the memory-allocation routines is found, or NULL if
you want to use the default callback routine.
The argument to the callback routine is one of the values of the
mcheck_status enumeration described in the documentation for
mprobe().
The default abort callback prints a message to stderr and aborts
the application.
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
The mcheck() function enables consistency checks within the memory
allocation routines.
When enabled, consistency checks are periodically performed on allocated
memory blocks as blocks are allocated or freed.
If an inconsistency is found, the abort callback is called with
the status identifying the type of inconsistency found.
|
Consistency checking isn't performed on blocks that you allocated before
calling mcheck(). |
The level of checking provided depends on which version of the allocator
you've linked the application with:
- C library — minimal consistency checking.
- Nondebug version of the malloc library — a slightly
greater level of consistency checking.
- Debug version of the malloc library — extensive
consistency checking, with tuning available through the use of the
mallopt()
function.
|
You can call mcheck() only once in a program. |
- -1
- Checking is already enabled.
- 0
- Checking wasn't already enabled.
QNX Neutrino
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |
mallopt(),
mprobe()
Heap Analysis
in the Programmer's Guide
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/m/mcheck.html on line 175
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/m/mcheck.html on line 175