4.8.11. __Heap_Valid()

Called from __heapvalid() to perform a consistency check on the heap data structures and attempt to identify an invalid or corrupted heap.


int __Heap_Valid(struct __Heap_Descriptor *h, int(*print)(void*, char const *format,...), void *printparam, int verbose);


It must output error messages and diagnostics using the suppliedprintf-type print routine. For example, by a call of the form:

print(printparam, "free block at %p is corrupt\n",block_addr);

This routine is effectively optional, because it is never called unless the user program calls __heapvalid().


The function must return nonzero if the heap is valid or zero if the heap is corrupted. It must use print to output error messages if it finds problems in the heap. If the verbose parameter is nonzero, it can also output diagnostic data.

Copyright © 1999-2001 ARM Limited. All rights reserved.ARM DUI 0067D