Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!apple!claris!wombat From: wombat@claris.com (Scott Lindsey) Newsgroups: comp.sys.apple Subject: Re: initializing APW C data structures Message-ID: <9130@claris.com> Date: 21 Mar 89 22:44:57 GMT References: <8903210858.aa20227@SMOKE.BRL.MIL> Organization: Claris Corporation, Mountain View CA Lines: 37 From article <8903210858.aa20227@SMOKE.BRL.MIL>, by AWCTTYPA@UIAMVS.BITNET ("David A. Lyons"): > > From _C Wizard's Programming Reference_, p. 66: "All scalar > variables can be initialized when defined. If the storage class of > the scalar is static, then the initialization occurs only once-- > conceptually by the compiler. In the case of auto and register > storage class scalar variables, the initialization assignment occurs > at each entry to the owning block." Register variables on the GS. That's a good joke :-) > But for initialized structures you have to use static objects in C. > If the GS had resources already, there'd be very little need for > static objects. (My old boss is working on a large MPW C program for > the Mac with a global variable count of either zero or one--I forget > which. His data structures are all allocated dynamically and rooted > in the REFCONs of his windows. Pretty slick, and extremely > weird-looking to read--more levels of indirectio and function calls > by pointers stored in tables than the mind is usually asked to > comprehend.) Yeah, if the GS had resources already, that's true. In AWGS, all document data is stored off of the RefCon as well. The overhead, though, for the 6 modules & everything else is respectable, but it could be cut at least in 1/2 by using resources: WIND's DLOG's ALRT's etc. I really want C to be a viable development enviroment for the GS. But I can't see it happening for at least a year. -- Scott Lindsey |"Cold and misty morning. I heard a warning borne in the air Claris Corp. | About an age of power when no one had an hour to spare" ames!claris!wombat| DISCLAIMER: These are not the opinions of Claris, Apple, wombat@claris.com | StyleWare, the author, or anyone else living or dead.