Borland C++ reference

farheapcheckfree

raw OCR

Checks the free blocks on the far heap for a constant value.

Defined in header <alloc.h>

Syntax

#include <alloc.h>
int farheapcheckfree(unsigned  int fillvalue);

Portability

DOSUNIXWindowsANSI CC++ only
■

Return value

The return value is less than zero for an error and greater than zero for success.

_HEAPEMPTYis returned if there is no heap (value 1).
_HEAPOKis returned if the heap is accurate (value 2).
HEAPCORRUPTis returned if the heap has been corrupted (value -1).
_BADVALUE (value -3).is returned if a value other than the fill value was found

See also

  • farheapfillfree
  • heapcheckfree
  • ^include
  • <mem.h>
  • ttinclude
  • <stdio.h>
  • tinclude
  • <alloc.h>
  • #define
  • NUM_PTRS
  • 10
  • #define
  • NUMJYTES
  • 16
  • int
  • main
  • char
  • far
  • *array[IPTRS]
  • int
  • i
  • j
  • res;
  • for
  • if
  • farmalloc==
  • NULL)
  • {
  • printfC'No
  • memory
  • for
  • allocation\n");
  • return
  • 1;
  • for
  • farfree;
  • if
  • <
  • 0)
  • {
  • printfC'Heap
  • corrupted
  • \n");
  • return
  • 1;
  • }
  • for
  • for
  • array[i][j]
  • =
  • 0;
  • res
  • =
  • farheapcheckfree;
  • if
  • switch
  • {
  • case
  • HEAPCORRUPT:
  • printfC'Heap
  • corrupted
  • \n")
  • ;
  • return
  • 1;
  • case
  • _BADVALUE:
  • printfC'Bad
  • value
  • in
  • free
  • space.\n");
  • return
  • 1;
  • default:
  • printf;
  • return
  • 1;
  • }
  • printf;
  • return
  • 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.