KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q38327: _Fheapwalk Does Not Check the Near Heap

Article: Q38327
Product(s): See article
Version(s): 5.10   | 5.10
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | S_QuickC | mspl13_c
Last Modified: 30-NOV-1988

The HeapWalk routines are provided as an aid in debugging heap-related
problems in programs. In large-, huge-, and compact-memory models
_heapwalk will map onto the function _fheapwalk. In small- and
medium-memory models, it maps onto function _nheapwalk. The _fheapwalk
function will not check or examine the near heap in the default data
segement while _nheapwalk will examine only the near heap.

Because _fheapwalk will not check the near heap, you should not assume
that the HeapWalk routine will always reflect information about all
your pointers when you are using compact-, large- and huge-memory
models. This is because in these models, malloc will draw upon the
far heap until it is exhausted, then turn to the near heap. In this
case, it is possible to have valid pointers but _fheapwalk will not
acknowledge them.

For this reason, you should not assume that _fheapwalk will provide
information about all your pointers, or you should use both _fheapwalk
and _nheapwalk to check both the near heap and the far heap.

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.