Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!husc6!endor!siegel From: siegel@endor.harvard.edu (Rich Siegel) Newsgroups: comp.sys.mac.programmer Subject: Re: Object Pascal and memory management Message-ID: <1289@husc6.harvard.edu> Date: 28 Feb 89 16:23:36 GMT References: <604330910.18716@minster.york.ac.uk> Sender: news@husc6.harvard.edu Reply-To: siegel@endor.UUCP (Rich Siegel) Organization: Symantec/THINK Technologies, Bedford, MA Lines: 23 In article <604330910.18716@minster.york.ac.uk> alistair@minster.york.ac.uk writes: >Can anyone out there explain how Object Pascal objects are allocated in memory, In Lightspeed Pascal (and probably in MPW Pascal as well), an OBJECT type is allocated as a handle in the heap; the first word of the handle is an A5-relative offset to the class info proc, and the rest of the space, I believe, is for the instance variables. It's important that the DECLARATION for an object type be in the main segment (or in some other segment that won't be unloaded or moved around), but the implementation of a method can be in any segment, as long as you don't do anything like unload your caller's segment. --Rich Rich Siegel Staff Software Developer THINK Technologies Division, Symantec Corp. Internet: siegel@endor.harvard.edu UUCP: ..harvard!endor!siegel Phone: (617) 275-4800 x305