Path: utzoo!attcan!uunet!lll-winken!elroy.jpl.nasa.gov!usc!julius.cs.uiuc.edu!apple!bbn.com!nic!chaos.cs.brandeis.edu!chaos!phils From: phils@chaos.cs.brandeis.edu (Phil Shapiro) Newsgroups: comp.sys.mac.programmer Subject: Re: 72 Extra Bytes of Globals? Message-ID: Date: 6 Nov 90 14:58:11 GMT References: <1990Nov5.184017.17820@portia.Stanford.EDU> Sender: @chaos.cs.brandeis.edu Organization: Symantec Corp. Lines: 27 In-Reply-To: ralphm@portia.Stanford.EDU's message of 5 Nov 90 18:40:17 GMT In article <1990Nov5.184017.17820@portia.Stanford.EDU> ralphm@portia.Stanford.EDU (Ralph Melton) writes: [ ... a problem with 72 bytes of globals in a code resource ... ] My sole hypothesis is that I am getting these troubles because I am using Object Pascal (not the Think Class Library). [ ... ] Is this correct? Does the use of objects demand global variables? I hugely hope not, because objects are the really excellent way to do what I want to do, and casing on tag fields of variant records would be a huge hassle. Your hypothesis is correct. Objects (in both Think Pascal and Think C) use global (A5) offsets to dispatch to their methods. Also, each object uses some global space for storing other information. In ThC, this isn't a problem since it allows globals and provides a fake jump table (all referenced off of A4). There isn't any way that I know of around this problem. One note: the actual error you got was from using the Pascal procedure new(), not from using objects. -phil -- Phil Shapiro Technical Support Analyst Language Products Group Symantec Corporation Internet: phils@chaos.cs.brandeis.edu