Registrations are now open. Join us today!
There is still a lot of work to do on the wiki yet! More information about editing can be found here.
Already have an account?

Microsoft KB Archive/38327

From BetaArchive Wiki

_fheapwalk() Does Not Check the Near Heap


5.10 6.00 6.00a 6.00ax 7.00 | 5.10 6.00 6.00a | 1.00 1.50 MS-DOS | OS/2 | WINDOWS kbprg ---------------------------------------------------------------------- The information in this article applies to: - The C Run-time (CRT), included with: - Microsoft C for MS-DOS, versions 5.1, 6.0, 6.0a, and 6.0ax - Microsoft C for OS/2, versions 5.1, 6.0, and 6.0a - Microsoft C/C++ version 7.0 - Microsoft Visual C++ for Windows, versions 1.0 and 1.5 ---------------------------------------------------------------------- In Microsoft C versions 5.1 and above, 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 does not check or examine the near heap in the default data segment, while _nheapwalk() examines only the near heap. Because _fheapwalk() does 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, calloc() and 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. Starting in C 6.0 calloc() and malloc() do not allocate from the near heap when the far heap is exhausted. 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. Additional reference words: kbinf 1.00 1.50 6.00 6.00a 6.00ax 7.00 KBCategory: kbprg KBSubcategory: CRTIss

Keywords : kb16bitonly
Issue type :
Technology : kbVCsearch kbAudDeveloper kbCRT

Last Reviewed: May 5, 2001
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.