Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
_heapwalk Functions
◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
The routines in the _heapwalk family help debug heap-related
problems in programs.
The _heapwalk routines walk through the heap, traversing one entry
per call. They return a pointer to an _heapinfo structure (defined
in MALLOC.H) that contains information about the next heap entry.
A call to _heapwalk that returns _HEAPOK stores the size of the
entry in the _size field and sets the _useflag field to either
_FREEENTRY or _USEDENTRY (both are constants defined in MALLOC.H).
To obtain this information about the first entry in the heap, pass
_heapwalk a pointer to a _heapinfo structure whose _pentry field
is NULL.
The various _heapwalk functions walk through the heap specified
below:
Function Heap Walked
_heapwalk Depends on data model of program
_bheapwalk Based heap specified by <seg> value;
_NULLSEG specifies all based heaps
_fheapwalk Far heap (outside default data segment)
_nheapwalk Near heap (inside default data segment)
In large data models (that is, compact-, large-, and huge-model
programs), _heapwalk maps to _fheapwalk. In small data models
(tiny-, small-, and medium-model programs), _heapwalk maps to
_nheapwalk.
Return Value
All four routines return one of the following manifest constants
(defined in MALLOC.H): _HEAPOK, _HEAPEMPTY, _HEAPBADPTR,
_HEAPBADBEGIN, _HEAPBADNODE, or _HEAPEND.
-♦-