Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
c++ - Pointer validation
Under 16-bit large model, what function can I use to determine whether a given pointer is actually a valid heap pointer, either _far or _huge. The memory management runtimes should be able to tell me this information. I looked in the documentation (web and PDF) but did not find anything. Mark Jun 04 2001
Mark, Which 16 bits platform are you working on? I suppose Win16? Win16 should have: IsBadCodePtr IsBadHugeReadPtr IsBadHugeWritePtr IsBadReadPtr IsBadStringPtr IsBadWritePtr HTH Jan Mark Evans wrote:Under 16-bit large model, what function can I use to determine whether a given pointer is actually a valid heap pointer, either _far or _huge. The memory management runtimes should be able to tell me this information. I looked in the documentation (web and PDF) but did not find anything. Mark Jun 04 2001
Yes Win16. When the functions are listed without parameters they look useful. This appearance is deceiving. One of the required parameters is the size of the allocation block. Even a good pointer is then reported as "bad" if the size with which it was allocated does not match the parameter to the function. So these functions strike me as defeating their own purpose. If I knew the block size then I would already know it was a good pointer. What I want is a function that will recognize *any* previously allocated __far or __huge pointer, of any size, without my having to track the size. Does DM have such a function in its runtimes? Mark On Mon, 04 Jun 2001 11:47:47 -0400, Jan Knepper <jan smartsoft.cc> wrote:Mark, Which 16 bits platform are you working on? I suppose Win16? Win16 should have: IsBadCodePtr IsBadHugeReadPtr IsBadHugeWritePtr IsBadReadPtr IsBadStringPtr IsBadWritePtr HTH Jan Mark Evans wrote:Under 16-bit large model, what function can I use to determine whether a given pointer is actually a valid heap pointer, either Jun 04 2001
Mark Evans wrote:Yes Win16. Jun 04 2001
|