Path: utzoo!utgpu!jarvis.csri.toronto.edu!torsqnt!tmsoft!masnet!canremote!beard@ux1.lbl.gov From: beard@ux1.lbl.gov@canremote.uucp (beard@ux1.lbl.gov) Newsgroups: comp.sys.mac.programmer Subject: Re: Think C 32K global data l Message-ID: <89122504043334@masnet.uucp> Date: 21 Dec 89 05:04:00 GMT Organization: Canada Remote Systems Limited, Mississauga, ON, Canada Lines: 62 From: beard@ux1.lbl.gov (Patrick C Beard) Subj: Think C 32K global data limit: workaround? Orga: Lawrence Berkeley Laboratory, Berkeley In article <37420@apple.Apple.COM> keith@Apple.COM (Keith Rollin) writes: >Ned, > >One of us - either you or me - doesn't know what you're talking about. When you >say that it doesn't address the issue of initialized data, what do you mean? >After all, MakeA5World is supposed to do this for you. By "this", I mean that >it creates space for your data, and initializes it all to zero, or with >predefined values if you are using C or Assembly. This is true. I've taken the tech note to task by creating independent code resources written in C++ that have global variables with initialized data. The ability to stuff objects in a code resource is really handy, I've written simple interfaces (objects) for encapsulating the nastiness that goes along with this MakeA5World stuff and hides it from me. >If you have other issues with the technote (like, for example, I forgot to >suggest that one call InitGraf when setting up his/her A5 world), then please >let me know. I've tried calling InitGraf to initialize my code resource's A5 world. It may have been that something else was making it crash, but is this a valid thing to do so that the A5 world will have properly initialized quickdraw variables? I've been stuffing values into the qd globals and it works. >Finally, I'd like to hear where you read "and I'll tell you how to live >without it." I tried to be accomodating. In cases where I said you couldn't do >something, I also tried to explain why. If I failed in some places please let >me know. What I want to know is when you will tell us how to create jump tables for our multi-segmented code resources. THINK C lets us do that. Take us one step closer to the capabilities they provide and the MPW languages will become a viable development environment for non-application code. Why? I want virtual functions in my code resources! Why must they be implemented (for C++ or Object Pascal) as jump table entries? I don't see why the method tables can't be resolved at data initialization time. It's easy to write code that computes the absolute addresses of methods and stuffs it into a table of function pointers. Thanks for global data, now give me jump tables! Then, rewrite MacApp in C++, then..., well I can dream. --------------------------------------------------------------------- ---------- - Patrick Beard, Macintosh Programmer (beard@lbl.gov) - - Berkeley Systems, Inc. "..............Good day!" - Paul Harvey - --------------------------------------------------------------------- ---------- --- * Via MaSNet/HST96/HST144/V32 - UN Mac Programmer * Via Usenet Newsgroup comp.sys.mac.programmer