+#define DEBUG_PRINTF(NAME) { static int raz=0; \
+ printf( #NAME " %i\n",raz); fflush(stdout); \
+ raz++; \
+ }
+
+ #include <malloc.h>
+ #include <stdio.h>
+
+ int HeapCheck(void)
+ {
+ int rc;
+
+ if (_HEAPOK != (rc = _heapchk()))
+ {
+ switch(rc)
+ {
+ case _HEAPEMPTY:
+ puts("The heap has not been initialized.");
+ break;
+ case _HEAPBADNODE:
+ puts("A memory node is corrupted or the heap is damaged.");
+ break;
+ case _HEAPBADBEGIN:
+ puts("The heap specified is not valid.");
+ break;
+ }
+ fflush(stdout);
+ }
+ return 0;
+ }