C Language and Libraries Help (clang.hlp) (Table of Contents; Topic list)
_heapwalk Functions
 Summary Example                         Up Contents Index Back
─────Run-Time Library───────────────────────────────────────────────────────
 
     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, and return a pointer to a structure of type
     _HEAPINFO that contains information about the next heap entry.
     The _HEAPINFO type, defined in MALLOC.H, contains the following
     elements:
 
     Element                Description
 
     int __far *_pentry     Heap entry pointer
     size_t _size           Size of heap entry
     int _useflag           Entry "in use" flag
 
     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
     the _heapwalk routine a pointer to a _HEAPINFO structure whose
     _pentry member 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.
 
     For _heapwalk, if the <seg> value is _NULLSEG, all based heap
     segments will be traversed; otherwise, only the specified based
     heap is walked.
 
     Return Value
 
     All four routines return one of the following manifest constants
     (defined in MALLOC.H):
 
     _HEAPOK           _HEAPEMPTY       _HEAPBADPTR
     _HEAPBADBEGIN     _HEAPBADNODE     _HEAPEND
                                    -♦-