Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!jarthur!uci-ics!rfg From: rfg@ics.uci.edu (Ronald Guilmette) Newsgroups: comp.lang.c++ Subject: Re: distinguishing stack/heap, garbage collection Message-ID: <25FAF100.24427@paris.ics.uci.edu> Date: 12 Mar 90 00:44:48 GMT References: <9084@shlump.nac.dec.com> Reply-To: rfg@ics.uci.edu (Ronald Guilmette) Organization: UC Irvine Department of ICS Lines: 25 In article <9084@shlump.nac.dec.com> nadkarni@ashok.dec.com writes: > >I'm just learning C++ so maybe I'm missing something obvious. How do you >distinguish between class objects allocated on the stack or static store >and those allocated on the heap ? Hummm... seems to me that we hashed this issue to death here in this newsgroup a few months back. As I recall, I pointed out that you could do some clever things by comparing an arbitrary address for an arbitrary object to certain other readily available addresses (e.g. current break value, current stack pointer, &etext, &edata, etc). I was roundly chastized for suggesting such a thing. Many people said that it would not be portable and the comparisons whould have to be rewritten for various machines and operating systems. I agreed, but claimed that the rewriting would be trivial. Did I leave out anything? // Ron Guilmette (rfg@ics.uci.edu) // C++ Entomologist // Motto: If it sticks, force it. If it breaks, it needed replacing anyway.