Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!brutus.cs.uiuc.edu!ginosko!cs.utexas.edu!rice!uw-beaver!apollo!mrst!sdti!wmm From: wmm@sdti.com (William M. Miller) Newsgroups: comp.lang.c++ Subject: Re: multiple destructors Message-ID: <1989Oct24.022726.2303@sdti.com> Date: 24 Oct 89 02:27:00 GMT References: <1989Sep30.190719.3340@polyslo.CalPoly.EDU> <6590273@hplsla.HP.COM> <1989Oct19.022635.123@sdti.com> <1989Oct21.182759.13138@paris.ics.uci.edu> Reply-To: wmm@sdti.SDTI.COM (William M. Miller) Organization: Software Development Technologies, Inc. Lines: 16 In article <1989Oct21.182759.13138@paris.ics.uci.edu> Ron Guilmette writes: >There is (I believe) a simple solution. On most UNIX systems, the actual >memory areas occupied by automatic (stack) variables, static variables, >and "heap" variables are all different. If you can get the starting and/or >ending addresses of these memory areas (and you usually can) then a quick >comparison of the address of a given object to these addresses will tell you >which area it is in. This is not portable to non-Unix systems, so I'm afraid it's an even dirtier trick than setting a flag in the allocated space. (I'm using DOS and OS/2, for example.) Thanks for the thought, though. -- Non-disclaimer: My boss and I always see eye-to-eye (every time I look in the mirror). wmm@sdti.sdti.com