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/mprobe.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/mprobe.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/mprobe.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/mprobe.html on line 8
Perform consistency check on memory
#include <malloc.h>
enum mcheck_status mprobe(void * ptr);
- ptr
- A pointer to the start of the heap block.
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
The mprobe() function attempts to perform consistency checks on
the allocated block specified by
ptr, which was previously returned by a call to
calloc(),
malloc() or
realloc().
Consistency checks look for inconsistencies within the block header or in the block trailer byte. They may also detect block overruns.
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.
One of the values of the mcheck_status enumeration:
- MCHECK_DISABLED
- Consistency checking isn't currently enabled, or consistency information isn't available for this block.
- MCHECK_OK
- There are no inconsistencies in this block.
- MCHECK_HEAD
- The block header is corrupted.
- MCHECK_TAIL
- The block trailer byte is corrupted or there has been a block overrun.
- MCHECK_FREE
- The ptr argument doesn't point to an allocated heap block.
QNX Neutrino
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |
Calling mprobe() on a pointer already deallocated by a call to
free() or realloc() could corrupt the memory
allocator's data structures and result in undefined behavior.
mallopt(),
mcheck()
The Heap Analysis chapter 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/mprobe.html on line 183
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/mprobe.html on line 183