Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: where does static data go when code segs are unloaded? Message-ID: <6550@hoptoad.uucp> Date: 16 Feb 89 23:05:01 GMT References: <17278@genrad.UUCP> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 20 In article <17278@genrad.UUCP> daf@genrad.UUCP (David A. Fagan) writes: >In C, global data is compiled as part of the executable image, right? No. >So what happens when the Memory Manager decides it's time to clean house? Nothing, as far as global data are concerned. They are stored in a segment of memory created by the _Launch trap outside the application heap zone. Globals and the memory manager don't interact, except of course that globals often point to memory manager data structures. This is as true of static variables as extern variables -- the only real difference is that static variables are only visible in the routine or source file in which they are declared. They're stored the same as externs. -- Tim Maroney, Consultant, Eclectic Software, sun!hoptoad!tim "I have recently been examining all the known superstitions of the world, and do not find in our particular superstition (Christianity) one redeeming feature. They are all alike founded on fables and mythology." -- Thomas Jefferson