stdlib.h, this function performs
a consistency check on the heap. It outputs full information about
every free block if the
is nonzero. Otherwise, it only outputs errors.
The function outputs its results by calling the output function
that must work like
fprintf(). The first parameter
dprint() is the supplied pointer
You can pass
fprintf() itself, provided you
cast it to the right function pointer type. This type is defined
as a typedef for convenience. It is called
If you call
fprintf() on a stream that
you have not already sent output to, the library calls
to create a buffer for the stream. If this happens in the middle
of a call to
__heapvalid(), the heap might
be corrupted. You must therefore ensure you have already sent some
stderr. The code in Example 2 fails if you have
not already written to the stream.
This function is not part of the C library standard, but is supported by the ARM C library as an extension.